This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Dblclick and Click event handlers not invoked - used jQuery Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Dblclick and Click event handlers not invoked - used jQuery" Watch "Dblclick and Click event handlers not invoked - used jQuery" New topic
Author

Dblclick and Click event handlers not invoked - used jQuery

amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 515
Hello,
I have implemented an UI based on jQuery event handlers that moves the OPTIONs between two HTML SELECT boxes.

It works great and fine but there is an issue that I have observed.

When the page comes up the double clicking on OPTION does not move the item to another HTML select. After that second double click onwards it starts responding and moving the OPTION items between the two lists.
I have written a JS function to move the items between two list and binding it to the double click event in document.ready() event.

Here is the JS Function that I have implemented. Trying to comment appropriately.



Thanks once again,
Amit


Regards,
Amit
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
option elements do not support click events in all browsers.

Eric
amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 515
Hello,
Thanks for your reply.
I am attaching the click and double click events to the HTML Select boxes.
The code posted wrongly shows OPTION elements alone. It has SELECT as well surrounding it.
I will update the code posted accordingly.
It does not work for the first time when HTML is loaded and thereafter it works fine.
Regards,
Amit
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61447
    
  67

You'll need to post the relevant HTML fragments.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 515
Hi Bear,
Thanks for your reply.
I am attaching a zip file (demo.zip) that has the cut-down version of what I am doing.
It took me a while to remove other things from the HTML so bit late in posting relevant HTML code.

I have one observation here though,
1) The same code works fine i.e. right from the first double click on SELECT box in FF 3.X
2) In IE 7 , browser asks us to allow the blocked content (which is related to restriction on Webpage from running Scripts/Active X controls etc etc.). After I do "Allow Blocked Content" , page loads and then does not respond to the first double click event. It happens with the buttons as well (These buttons are not part of the demo.html).

Below is the code for the demo.html ( I could not attach the file to this message).It depends on "jquery-1.3.2.min.js".




Thanks in advance,
Amit
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61447
    
  67

Sorry, but if this is an IE-only problem, I don't have a Windows installation currently that I can test upon.
amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 515
Hi Bear,
Thanks anyways. Never mind. I will certainly post if I can overcome this issue.

Regards,
Amit
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dblclick and Click event handlers not invoked - used jQuery