...

View Full Version : multiple events via onmouseover



subhailc
02-08-2004, 01:27 PM
morning all,

i'm sure this is a simple fix and i'm an idiot, but hopefully someone can spot this and help me out - it's 5:30 in the morning and i'm ready for bed :)

the following script renders other onmouseover effects attached to a link ineffective - i thought of adding the other events to the lnk.mouseover= line, but the effect i need is a change image that's specific to the link in question. i tried removing the initTrans portion and calling out onMouseOver="transOn" for each link, but that didn't work either.

Thanks in advance for anything you can contribute.
<STYLE TYPE="text/css">
.textTrans{
font-size:12px;
text-decoration:none;
border: 1px solid #470509;
width:200px;
height:12px;
filter: progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1,wipestyle=1,motion=forward,duration=.5 )}
</style>

<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>
<body onLoad="initTrans()">

glenngv
02-09-2004, 03:11 AM
function initTrans()
{
for(var i=0 ; i<document.links.length ; i++)
if(document.links[i].className == "textTrans")
{
var lnk=document.links[i];
var mOver = lnk.onmouseover;
var mOut = lnk.onmouseout;

lnk.onmouseover=(mOver) ? function(){mOver();transOn()} : transOn;
lnk.onmouseout=(mOut) ? function(){mOut();transOff()} : transOff;
}
}

subhailc
02-09-2004, 03:57 AM
Thank you very much, Glenn. :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum