3

I have a link in my webpage that opens up a dialog that contains some content. Besides showing the content in the dialog. I am also planning to allow that if the user wants to open this content in a new tab instead, he may simply,

  1. right-click (on the same link) , then
  2. select Open link in new Tab.

Thus, for showing a particular content, the same link open up a dialog if there is a click event but opens up a new tab loaded with information if user right-clicked & selected to open in new tab.

Does it sound like a good idea ? Are there any any usability concerns associated with this ?


EDIT :

======

I think I could not made my point very clear through my question above. Let me present an example scenario thus.

Consider an application like Gmail which displays lists of emails. Now when you want to see a message, you simply click on it and it opens up in the same tab. Very nice! But what if user wants to open that email in a new tab and keep the inbox list tab intact in the original tab. Unfortunately the Gmail UI doesnt provide this facility. But if you want to provide this facility(to open email in new tab) as well besides allowing to open the content in original tab (through dialog box), I guess a good option would be to allow user to select through right-click if he wants to open the content in new tab.

Like if you see in the Gmail case as well, I think they might be showing up the email content through a dialog box overlay only but, it is just that, this doesnt have the appearance of dialog box but just another page.

I am trying this to provide just an added facility. But if device/browsing software doesn't allow for opening content in new tab, this extra facility wont be there simply and the user can just see the content in the same tab through simple click.

2
  • 1
    Actually, GMail does it the other way round. If you simply click Compose or Reply, it opens up in the current tab. If you shift-click Compose or Reply it opens up in a new window. Commented Aug 21, 2011 at 8:25
  • Yeah this is exactly what I am trying to say.. I guess you may be confused if you are left handed. I said according to right handed person. Commented Aug 21, 2011 at 8:31

4 Answers 4

7

What you're suggesting is actually a best practice for creating accessible functionality with unobtrusive Javascript. The code generally looks something like this:

<a href="/somewhere" id="dialog-link">Open dialog</a>

This is associated with some Javascript:

$("#dialog-link").click(function(evt) { /* Do something */ evt.preventDefault(); });

Using Javascript, the default behaviour of the link (visiting the URL /somewhere) is prevented, allowing you to execute some Javascript instead. In this case that would be displaying the dialog to the user. Ideally you would load the contents of the URL /somewhere into the dialog using AJAX.

If the user's browser for some reason doesn't have Javascript turned on, or doesn't support Javascript, the event listener won't fire, and the link will just be opened as it is.

However, since the hyperlink is just that - a standard hyperlink - this allows me to rightclick and open the targeted URL in a new tab using standard browser context menus as I would any other link, because the event listener is only listening for a left click.

So should you do this? Yes. It's more accessible, more user-centered, and overall more usable because it allows users to handle the link differently if they want, but provides default, rich responsive behaviour in sync with your app by default.

0
4

I do not like the idea of the user having to make an extra click just to open it in a new window. My middle mouse button click on any link opens the page in a new tab, isn't that an in-built browser feature?

anyways, I think web-developers should only depend upon the users's 'left click' to add functionality on a webpage , 'right click' is more of a browser context menu.

If you really want to have such a feature maybe you can try something like this:

some link

on hover, becomes

some link (or click here to open in new tab)

1
  • +1 for middle click, that's the primary way of opening new tabs, don't ever open a new tab for me, let me decide if I want a new tab or not by middle click. But -1 because that hover idea is horrible. So +0.
    – Lie Ryan
    Commented Sep 2, 2011 at 9:45
2

As I sit here on vacation, typing this answer into my blackberry, I'm wondering to myself how I go about right clicking on a link to open content in another tab when using a browser that has no tab based browsing and the mobile has no mouse.

Design for mobile first.

Actually I have several browsers installed and I do have tabs available - but the default browser does not. Nevertheless, right clicks are a bit of a problem on mobiles.

For desktop browsers, they mostly allow you to open a link in a new tab or a new window anyway so I'm not sure why you are making a special case for it here.

Finally, I have an issue with links opening dialogs. Dialogs (if really needed) should be opened by clicking on buttons not links. This is because the dialog is action related not content navigation related. Links should open or jump to content in the current page or a blank page - or similar. When you mix these up, the interactions get muddled and confusing.

1
  • Thanks @Roger Attrill ! I have edited my question to bring more clarity. I hope you'll be able to understand my scenario & use-case better after going through it. Commented Aug 21, 2011 at 2:50
0

Do you have any sense of whether users want the alternate action all the time, or only rarely? If you think they might have a non-majority preference, then I'd make an option available to them to open all clicked items in a new tab instead of the dialog.

I usually don't think to add options or alternate paths for things that the browser natively provides. But if your audience isn't likely to know about those little extras like how to force a link into a new tab, it's best to provide for it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.