www.webdeveloper.com
Results 1 to 5 of 5

Thread: disable shift click to open new window in IE6

  1. #1
    Join Date
    Nov 2008
    Posts
    2

    disable shift click to open new window in IE6

    I can't think of a way to get around this problem please help!
    (I'm not the main developer of the project, but just as a temp helper, so I don't understand the entire app clearly....)

    What I want to do:
    to disable a new window to pop up for a shift+left click.

    Description:
    The intention of the app is to allow user to select a range of things with the shift+left click command. It's working like it should in Chrome.

    The problem is that, in IE6, while doing a shift+left click, it will open up a new window with "Javascript:___doPostBack(blah blah blah)" in the URL address bar, the app didn't actually response to the shift+left click at all. The interesting thing is that, it will perform the operation of a shift+left click on the next regular left click! lol



    possible solution:
    1. I found out that, for IE6, the new window is opened when you release a left click while holding shift. (so it's triggered on a mouse release in opposed to mouse pressed). Is it possible for me to use the mouseUp function somehow, to make the browser to treat a shift+left mouse release as a left mouse release?

    2. Can't change the interface design

    3. any other suggestion that can help will be great!



    Thanks a lot for your time in reading this

  2. #2
    Join Date
    Nov 2002
    Posts
    4,473
    The shift key sets a flag that can be examined in the event handler, either onclick or onmouseup/down/over/out.

    If you use "return false" in an event, the default handler is aborted, and the action described should be prevented.

  3. #3
    Join Date
    Nov 2008
    Posts
    2
    do you mean it by setting event.shiftKey to as false?
    or do you mean it by setting the mouseUp to be returning false?

    thanks!

  4. #4
    Join Date
    Nov 2002
    Posts
    4,473
    Quote Originally Posted by johnnypung View Post
    do you mean it by setting event.shiftKey to as false?
    No, by testing it to see if it set and doing something different in the routine.
    Quote Originally Posted by johnnypung View Post
    or do you mean it by setting the mouseUp to be returning false?
    Code:
    <a href="..." onwhatever="doSomething();return false">

  5. #5
    Join Date
    Apr 2006
    Location
    Houston
    Posts
    1,374
    Just have an onClick condition call a function and in that function check for the shift event and put a "return false" at the end of it.

    Here is a partial example from a function I created to select a range of rows in a table rows using shift/click

    Code:
    function shiftSelect(thisRow) {
    	var event = (this.event) ? this.event : shiftSelect.caller.arguments[0] || window.event;
    
    	// If Shift key was selected
    	if (event.shiftKey) {
    	  .
    	  .
    	  .
    	}
    	.
    	.
    	.
    	return false;
    }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles