SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    May 2000
    Posts
    229
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Im quite dumb when it comes to javascript... just havent gotten the time to learn it yet =(

    Can someone pass me a function to use for mouseovers or a link to somewhere that I can find one?

    i would like it to work on as many browsers and versions as possible and I cant write anything that good <=(

    I would be much much appreciative!!!

    (P.S. if you print the function on this board, could u please clerify what I would have to pass to the function o do the image swap?)

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    jizbot...here you go...everything you need...

    try this script for rollovers

    <script language="javascript">
    <!--

    if (document.images) {
    image1on = new Image();
    image1on.src = "images/about_us_on.gif";
    image1off = new Image();
    image1off.src = "images/about_us_off.gif";
    }

    function changeImages() {
    if (document.images) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
    document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
    }
    }
    }

    // -->
    </script>

    and you call it like this:

    <a href="about_us.shtml" onmouseover="changeImages('image1', 'image1on')" onmouseout="changeImages('image1', 'image1off')">text or image here</a>
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    SitePoint Addict
    Join Date
    May 2000
    Posts
    229
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey creole
    i pasted in the code chunk and gave it a whirl but i got an error.
    I tried to debug it but Im about as good at that as I am at spittin in the wind <=(

    maybe im not sure what variables can be changed?

    I assume that the top if function will preload all my rollover images and assign them to a name that javascript will recognize?

    do i need to put a name tag into the image used for the link??

    i tried to name it "image1" but no dice...

    i really appreciate your help and look forward to your response.
    if its easier for you to talk VIA ICQ i could email u my number?

  4. #4
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can give me a holler if you like...1355506. I only use it at home though; after 6pm you can check me.

    The only part you should need to change is the portion in the HREF tag.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes


Bookmarks

Posting Permissions

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