That's what the class selector is for, selecting an entire class of elements. In other words, yes. You only need one class, this may be used with all of your tips. However, you cannot have hover effects for a span (or anything other than a link) in css in IE 6 and earlier (works fine in IE 7 and other modern browsers). But, since you are mousing over and out of the span to to activate the tip anyway, a class change could be made in the script:
Code:
function ddrivetip(el, thetext, thewidth, thecolor){
if (ns6||ie){
el.className=el.className+'over';
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}
and:
Code:
function hideddrivetip(el){
if (ns6||ie){
el.className=el.className.replace(/over$/,'');
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}
The tip would look like:
Code:
<span class="mytip"
onmouseover="ddrivetip(this,'Whatever text for this tip', 250);"
onmouseout="hideddrivetip(this);">activating text</span>
and in your stylesheet:
Code:
.mytip {
color:#0000fe;
}
.mytipover {
color:#0000fe;
text-decoration:underline;
}
Bookmarks