- Create Account

Manually closed AND when mousing off trigger

Forums > SuperNote > Manually closed AND when mousing off trigger
Author
Message

1) Tim Group: Guests
IP: 64.32.--.--
I love this script. Great work and easy to use. I'm trying to combine the behavior where you click the x to close the note, and also have the window close when your mouse leaves the trigger (but not if your mouse is in the note). The situation is that the trigger is an image and the note may have text that the user should copy and paste, but if the user moves on to another picture, the old note should close and the new one open. But the user should also be able to click to close the note.

Thanks in advance!!

2) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 203.118.--.--
1) Put the close-note "X" button HTML inside a regular note.
2) In the main SuperNote HTML file, replace this line within the document click handling function:

  if ((/snb-pinned/).test(elm.className))  { note = elm; break }

with  this:

  if ((/snp-/).test(elm.className))  { note = elm; break }

(which  will detect the letters "snp-" within a note classname to identify an element as being a note, I assume that will work with your design).

Good luck - Angus.

Post a Reply:

You are not logged in, and will be posting anonymously as a guest. If you want to post using an account, please login at the top of this page.