Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Rob Dennett
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64712
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
srcElement is non-standard. Try e.target.

(You have no excuse -- I know you have my book! )
 
Rob Dennett
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64712
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the function context (this) set to?
 
Rob Dennett
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It also contains the overlay object.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64712
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64712
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
e.originalTarget is undefined, but e.originalEvent.originalTarget has the closing element.

Rob
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64712
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So much for standards and conventions!

Glad you found what you needed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic