aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Need help determining when a jQuery Tools overlay has been closed (not working in FF) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Need help determining when a jQuery Tools overlay has been closed (not working in FF)" Watch "Need help determining when a jQuery Tools overlay has been closed (not working in FF)" New topic
Author

Need help determining when a jQuery Tools overlay has been closed (not working in FF)

Rob Dennett
Ranch Hand

Joined: Dec 07, 2010
Posts: 79
I am using a jQuery Tools overlay to present a dialog box to the user. If the user clicks on the close button, I need to trigger an event noting that fact. The code I wrote to do it works in Chrome and IE, but fails in Firefox on both Mac and Windows.

(the onClose property is part of the object I use to initialize the overlay)



In Firefox, e.srcElement is undefined. So is e.originalTarget. Does anyone know of a workaround for this issue?

Thanks, Rob
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

srcElement is non-standard. Try e.target.

(You have no excuse -- I know you have my book! )


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Rob Dennett
Ranch Hand

Joined: Dec 07, 2010
Posts: 79
e.target doesn't work. It contains the overlay object itself. I need to get a handle to the closing element. Failing that, I need to figure out that the overlay dialog was cancelled as opposed to accepted.

Thanks,
Rob
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

What is the function context (this) set to?
Rob Dennett
Ranch Hand

Joined: Dec 07, 2010
Posts: 79
It also contains the overlay object.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

Wow, that's one screwed up widget that's not following any of the conventions.

If I come with any other brought ideas (short of chaining the widget code), I'll chime in again.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

A quick look at the docs and it looks they may be setting the real target into e.originalTarget... try that.

(If my eyes were rolling any harder, I'd injure myself.)
Rob Dennett
Ranch Hand

Joined: Dec 07, 2010
Posts: 79
e.originalTarget is undefined, but e.originalEvent.originalTarget has the closing element.

Rob
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

So much for standards and conventions!

Glad you found what you needed.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help determining when a jQuery Tools overlay has been closed (not working in FF)
 
Similar Threads
How to count the active users
Walking the DOM tree
how to get the object which user clicked
live binding the load event in jQuery
jquery datepicker not working