SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Enthusiast sparq-l's Avatar
    Join Date
    Mar 2001
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I need a resource that has an easy to use mouseover script, that works with more than 1 mouseover per page

  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)
    I am guessing that you want to be able to rollover one image and have 2 or more images change. Is that what you mean? If so then take a look at this page:

    http://www.kbxl-kspd.com/index.shtml


    Then use this script: This part goes inside the HEAD tag.

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

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

    listen_to_us_on = new Image();
    listen_to_us_on.src = "listen_to_us_on.gif";
    listen_to_us_off = new Image();
    listen_to_us_off.src = "listen_to_us_off.gif";

    contact_us_on = new Image();
    contact_us_on.src = "contact_us_on.gif";
    contact_us_off = new Image();
    contact_us_off.src = "contact_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>

    This part goes in the body tag:

    <a href="about_us.shtml" onmouseover="changeImages('image1', 'image1on'); changeImages('listen_to_us', 'listen_to_us_on')" onmouseout="changeImages('image1', 'image1off'); changeImages('listen_to_us', 'listen_to_us_off')"><img name="image1" src="about_us_off.gif" alt="About Us" width="133" height="18" border="0"></a>

    Note that I am simply calling the "changeimages" twice in each "onMouseOver" event. There might be an easier way to do this, but this method will work.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    SitePoint Enthusiast sparq-l's Avatar
    Join Date
    Mar 2001
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I guess I should have been more clear.

    Check my site www.sparq-l.com you'll see the buttons I have. I want a different script than the one I currently use because IE shows it as having an error on the page.

  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)
    That;s fine. You are still more than welcome to use the code that I posted. Simply remove ONE of the Changeimages function calls in each section of the HREF tag.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  5. #5
    SitePoint Enthusiast sparq-l's Avatar
    Join Date
    Mar 2001
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cool, thanks a lot!


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
  •