Results 1 to 2 of 2

Thread: (JAVASCRIPT HELP) Fading Link

  1. #1

    Thread Starter
    Fanatic Member JCScoobyRS's Avatar
    Join Date
    Oct 2002
    Location
    Some Mountain in Colorado
    Posts
    677

    (JAVASCRIPT HELP) Fading Link

    I downloaded a script from Planet Source Code to fade my links when moused over. Here is the relavant code I need help with:

    Code:
    function domouseover() { 
    if(document.all){ 
    var srcElement = event.srcElement; 
    if ((srcElement.tagName == "A" && autoFade) || srcElement.className == "fade" || (sloppyClass && srcElement.className.indexOf("fade") != -1)) 
    fade(startColor,endColor,srcElement.uniqueID,stepIn); 
    } 
    }
    I have bolded the portion in question. How can I make it where the event, "domouseover()" only occurs if the element has "onmouseover='domouseover()'"? Right now, every link on my page fades in and out and that is undesirable. Also, where can I get resources telling me how to do this kind of stuff myself? Thanks, Jeremy
    He who listens well, speaks well.

  2. #2
    Member JuiCe's Avatar
    Join Date
    May 2001
    Location
    Philly
    Posts
    46
    Code:
    <a href="page.html" onmouseover="doMouseOver('#FFFFFF','#000000',this,?>Link</a>
    
    function doMouseOver(obj) {
    	if (document.all) fade(startColor,endColor,obj,stepIn); 
    }
    That should work, but I'm not sure how your fade() function is coded. If it doesn't work, paste the function so I can see what it's doing.
    JuiCe

Posting Permissions

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



Click Here to Expand Forum to Full Width