PDA

View Full Version : Sticky Tooltip script



cavenj
12-16-2010, 01:09 PM
I used the "Sticky Tooltip script" ( http://www.dynamicdrive.com/dynamicindex5/stickytooltip.htm )
with <area> tag inside an image-map.

How to change the border color (red) of the box in sticky position (after click right) ?

In the file "stickytooltip.js", I changed the darkred color (parameter "stickybordercolors"). It only changes the background color of "Click outside this box to hide it" , but not the border color.

Thank you.

jscheuer1
12-16-2010, 05:21 PM
This script is full of, I don't know what to call them, I guess 'issues' would be about as good as any.

To fix this particular issue, find:


hidebox:function($, $tooltip){
if (!this.isdocked){
$tooltip.stop(false, true).hide()
$tooltip.css({borderColor:'black'}).find('.stickystatus:eq(0)').css({background:this.stickybordercolors[0]}).html(this.stickynotice1)
}
},

docktooltip:function($, $tooltip, e){
this.isdocked=true
$tooltip.css({borderColor:'darkred'}).find('.stickystatus:eq(0)').css({background:this.stickybordercolors[1]}).html(this.stickynotice2)
},

and change the highlighted as shown:


hidebox:function($, $tooltip){
if (!this.isdocked){
$tooltip.stop(false, true).hide()
$tooltip.css({borderColor:this.stickybordercolors[0]}).find('.stickystatus:eq(0)').css({background:this.stickybordercolors[0]}).html(this.stickynotice1)
}
},

docktooltip:function($, $tooltip, e){
this.isdocked=true;
if(this.stickykillclicks){
$('body').bind('click', this.killclicks);
}
$tooltip.css({borderColor:this.stickybordercolors[1]}).find('.stickystatus:eq(0)').css({background:this.stickybordercolors[1]}).html(this.stickynotice2)
},

I have a blog entry on this script where I have other modifications to deal with the various other issues that have so far been identified. I updated it to include this fix. It's located at:

http://www.dynamicdrive.com/forums/blog.php?b=48

I strongly recommend that you use its script instead. That way you need not modify your current version.