Forums >
SuperNote >
Manually closed AND when mousing off trigger
Author
Message
1) TimGroup: Guests IP: 64.32.--.--
Posted:
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 TurnbullGroup: Moderators Posts: 4042Joined: 7 Dec 2003Location: New ZealandIP: 203.118.--.--
Posted:
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).