requires a new function and minor change
Code:
delayshowhide:function(action,ms){
var oop=this;
clearTimeout(oop.to);
if(typeof(ms)=='number'&&(action=="show"||action=="hide")){
oop.to=setTimeout(function(){ oop.showhidenote(action); },ms);
}
},
showhidenote:function(action, callback){
clearTimeout(this.to);
var $=jQuery
var thisobj=this
if (action=="show"){
this.$note.css('zIndex', stickynote.startingzindex++)
this.positionnote($, this.s.pos[0], this.s.pos[1])
if (this.s.fixed){
$(window).bind(this.reposevtstring, function(){thisobj.positionnote(jQuery, thisobj.s.pos[0], thisobj.s.pos[1])})
}
this.$note.fadeIn(this.s.fade? 500 : 0, function(){
thisobj.positionnote($, thisobj.s.pos[0], thisobj.s.pos[1])
if (typeof callback=="function")
callback()
if (document.all && this.style && this.style.removeAttribute)
this.style.removeAttribute('filter') //fix IE clearType problem
})
}
else if (action=="hide"){
this.$note.hide()
if (this.s.fixed){
$(window).unbind(this.reposevtstring)
}
}
},
then use
Code:
<a href="#" onClick="mysticky.delayshowhide('show',2000);return false">Show Box 1</a>
<a href="#" onClick="mysticky.delayshowhide('hide',2000);return false">Hide Box 1</a>
where 2000 is the delay
Bookmarks