Web Design problem... PLEASE HELP

Discussion in 'Web Design and Development' started by mogzieee, Mar 13, 2008.

  1. mogzieee macrumors 6502a

    Joined:
    Feb 8, 2008
    Location:
    London, UK
    #1
    If theres any web designer out there can they help me please!

    I'm making an HTML webpage, but i can't get this rollover image/link to work... is there something wrong with the code below?? Or is it just my computer messing up??

    <A
    HREF="www.google.com"
    onMouseOver = "rollover('home')";
    onMouseOut = "rollout('home')";
    ><IMG SRC="home_out.gif";
    NAME="home";
    ALT="Home Page"; BORDER=0
    HEIGHT=130 WIDTH=115
    ></A>
    <SCRIPT TYPE="text/javascript">
    <
    setrollover("home_over.gif");
    >
    </SCRIPT>


    Some other things to note (that may help you):
    * my pictures "home_out" and "home_over" are in .gif format and saved on the Desktop
    * my html site is also saved on the desktop for the time being....



    ANY help would be GREATLY appreciated...! THANKS
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    Can you provide more of the JavaScript? You only provided one line and it doesn't have any meaning on its own.
     
  3. zirkle2007 macrumors 6502

    zirkle2007

    Joined:
    Sep 25, 2007
    Location:
    Indiana, USA
    #3
    I think since he only provided one line, thats the problem. I don't think the Java is programmed into. I could be wrong, its been awhile since I've coded that particular thing, but I'm sure there is more to it.
     
  4. ChicoWeb macrumors 65816

    ChicoWeb

    Joined:
    Aug 16, 2004
    Location:
    California
    #5
    Seems like a lot of extra work that can be done with CSS and "sliding" backgrounds on hover state.
     
  5. bozigle macrumors regular

    #6
    <html>
    <head>
    <script language="JavaScript">
    <!-- hide
    function mouseOverPaint(){
    document.namepix.src ="pixover.jpg"
    }

    function mouseOutPaint(){
    document.namepix.src ="pixout.jpg"
    }
    //-->
    </script>
    </head>
    <body>
    <A HREF="#" onmouseOver="mouseOverPaint()" onmouseOut="mouseOutPaint()" >
    <IMG name="namepix" src="pixout.jpg"/>
    </A>
    </body>
    </html>



    A good place to check and learn html/javascript is http://www.w3schools.com/js/default.asp
     
  6. ChicoWeb macrumors 65816

    ChicoWeb

    Joined:
    Aug 16, 2004
    Location:
    California
    #7
    Or something like. Keep in mind you have to make an image that has the normal state on one side, and the rollover on the other, so the size below is half of the original image size.

    Here is the image.

    http://www.chicowebdesign.com/images/nav/home.gif

    Code:
    
    #home a, #home a:link, #home a:visited {
    	background: url(imgs/nav/home.gif) 0 0 no-repeat;
    	width: 100px;
    }
    
    #home a:hover  {
    	background-position: -100px 0;
    }
    
    
     
  7. mogzieee thread starter macrumors 6502a

    Joined:
    Feb 8, 2008
    Location:
    London, UK
    #8

Share This Page