Web Analytics Made Easy -
StatCounter multiple events via onmouseover - CodingForum

Announcement

Collapse
No announcement yet.

multiple events via onmouseover

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • multiple events via onmouseover

    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: progidXImageTransform.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()">

  • #2
    Code:
    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;
      }
    }
    Glenn
    vBulletin Mods That Rock!

    Comment


    • #3
      TYVM

      Thank you very much, Glenn.

      Comment

      Working...
      X