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
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Adding a rollover image to a .js file script

    Hi, much thanks to anyone who can help me out here!

    .. I am building a gallery website to showcase my photography and illustration. All things are going swimmingly, except now I am stuck!

    I am using a js resize script to handle the display of my images on different res settings. It looks wonderful, but I have one image I would like to add a rollover effect to

    ...is it possible to include something like that in the script shown below? I've been trying to figure out how for the last week, but my grasp on js is not exactly strong

    FYI rollover image src=175illustration-hover.png


    // JavaScript Document
    if (screen.height >= 1024 && screen.width >= 1280) {
    document.write("<img src='175illustration.png' border=0>");
    }
    else {
    if (screen.height >= 768 && screen.width >= 1024) {
    document.write("<img src='130illustration.png' border=0>");
    }
    else {
    document.write("<img src='90illustration.png' border=0>");
    }
    }
    // End -->

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    you could try

    document.write("<img src='175illustration.png' border=0 onmouseover='this.src=\"175illustration-hover.png
    \"' onmouseout='this.src=\"175illustration.png\"'>");
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.

  • #3
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you so much!

    the code worked exactly how i needed it to, now I am officially eternally in your debt!

    ===Mythik


  •  

    Posting Permissions

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