I'm assuming you're using the current version of the script. That old thread was for an outdated version anyway.
Use this updated version of the current script (right click and 'Save As'):
stickynote.js
With this attached updated script you specify cookie instead of session, and if you like, optional days, example:
Code:
var mysticky2=new stickynote({
content:{divid:'stickynote2', source:'stickydata.txt'},
pos:['right', 'bottom'],
showfrequency:'cookie',
days: 7 //<--no comma following last setting!
})
The keyword session is no longer valid. You can still use 'always' if you like, or an integer for displaying it at random a percentage of the time. But previous cookies, if any would have to be cleared in the browser. If 'cookie' is used and no days are specified it will be a session only cookie. If days are specified, it will persist for that many days.
The attached updated script also allows you to put an opt out checkbox in any stickynote, example:
Code:
<div id="stickynote2" class="stickynote">
Opt Out: <input type="checkbox" class="optout" /><br />
Use this <a href="http://tools.dynamicdrive.com/gradient/"><b>Online Gradient Tool</b></a> to painlessly generate a gradient image of 3 types, with instant previewing so you get exactly what you had in mind. <a href="#" onClick="mysticky2.showhidenote('hide');return false">[Hide Box]</a>
</div>
It can go anywhere within the stickynote. The only requirements are that it be a checkbox and that it have a class of optout as shown.
Checking it will opt the user out of that sticky for 10 years or until they delete the cookie, whichever comes first. Unchecking it will revert to whatever the default showfrequency for that sticky is.
The browser cache may need to be cleared and/or the page refreshed to see changes.
Any questions, feel free to ask. But . . .
If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
Bookmarks