...

View Full Version : change from rewriting <a> tags to requiring callout



subhailc
02-08-2004, 04:44 PM
change from rewriting <a> tags to requiring callout
this question is regarding a problem i posted re: earlier, but perhaps approaching it from a different position might be easier.

how would i change this script so it did NOT rewrite all links with the onmouseover and onmouseout events, but did enable me to use those by indicating onmouseover=transOn etc. within each <a> tag i wanted to apply it to?





<script type="text/javascript">
function initTrans()
{
for(var i=0 ; i<document.links.length ; i++)
if(document.links[i].className == "textTrans")
{
var lnk=document.links[i];
lnk.onmouseover=transOn;
lnk.onmouseout=transOff;
}
}
function transOn()
{
if(this.filters != null) this.filters[0].stop();
if(this.style)
{
this.style.backgroundColor = "#470509";
this.style.color = "#111111";
}
}
function transOff()
{
if(this.filters != null) this.filters[0].apply();
if(this.style)
{
this.style.backgroundColor = "#FFFFFF";
this.style.color = "#470509";
}
if(this.filters != null) this.filters[0].play();
}
</script>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum