#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Location
    I'll tell you if you tell me.
    Posts
    45
    Rep Power
    13

    Arrow JAVASCRIPT help needed.


    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 part of code I need to understand. Right now, this script is looking for all <A> tags and performing the domouseover function. What I'd like to be able to do is look in all <A> tags for a certain value and only perform if that value is there. Example:

    Code:
    <a href="http://www.yourhome.com" onmouseover="domouseover()">Link</a>
    I want for all <A> tags to "looked into" to search for the onmouseover event, if it exists, do function, if not, don't do function. Does this make sense? Thanks, Jeremy
    If you can't figure it out yourself, suck it up and ask someone else.

    DeveloperKB
  2. #2
  3. No Profile Picture
    Senior Citizen
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2001
    Location
    leftcoast
    Posts
    2,019
    Rep Power
    16
    Does this make sense?
    No.

    Why not describe, in general terms, the effect you'd like to achieve, and leave the technique open to suggestion. Also: where'd you get that script from?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Location
    I'll tell you if you tell me.
    Posts
    45
    Rep Power
    13

    Explanation


    I got the script from Planet Source Code and it's to fade my links. The only problem, is that it fades every link even. I don't want it to fade every link, just the ones that I want. If I want it to fade, I want to put 'onmouseover="domouseover()"' in the <a> tag of the link. Does this make better sense? Thanks, Jeremy
    If you can't figure it out yourself, suck it up and ask someone else.

    DeveloperKB
  6. #4
  7. No Profile Picture
    Senior Citizen
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2001
    Location
    leftcoast
    Posts
    2,019
    Rep Power
    16
    1) Set the variable autoFade to false
    2) Add this:

    <a......class="fade" onmouseover="domouseover()">

    ...to any link you'd like to fade

    3) Read the documentation next time (right in Readme.txt). I wouldn't even use this script (it's Internet Explorer only)

    Also: when referring to a separate script in this forum,
    please supply a link so we don't have to go searching...

    hth, adios
    Last edited by adios; November 14th, 2002 at 12:22 AM.

IMN logo majestic logo threadwatch logo seochat tools logo