Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jan 2004
    Posts
    185
    Thanks
    2
    Thanked 1 Time in 1 Post

    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
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,030
    Thanks
    0
    Thanked 247 Times in 244 Posts
    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;
      }
    }

  • #3
    Regular Coder
    Join Date
    Jan 2004
    Posts
    185
    Thanks
    2
    Thanked 1 Time in 1 Post

    TYVM

    Thank you very much, Glenn.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •