Do you mean click anywhere outside it, or on a specific link or image outside of it?
If you want 'anywhere outside it' add the jQuery(function($) as shown:
Code:
var mysticky2=new stickynote({
content:{divid:'stickynote2', source:'stickydata.txt'},
pos:['right', 'bottom'],
showfrequency: 'cookie',
days: 7,
delay: 10 //<--no comma following last setting!
});
jQuery(function($){
var thenote;
$('*').bind('click', function(e){
thenote = $('#stickynote2, #stickynote2 *');
if(thenote.index(e.target) > -1){return;}
mysticky2.showhidenote('hide');
});
});
Notice where information (highlighted/colored) in the init for the stickynote must match that in the added code.
If you just want a link or image, add an onclick to it, ex:
Code:
<a href="#" onclick="mysticky2.showhidenote('hide'); return false;">Close That Box!</a>
There's another option, the hidebox option:
Code:
var mysticky2=new stickynote({
content:{divid:'stickynote2', source:'stickydata.txt'},
pos:['right', 'bottom'],
showfrequency: 'cookie',
days: 7,
hidebox: 20,
delay: 10 //<--no comma following last setting!
})
That will hide the box after 20 seconds.
Bookmarks