SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Former Staff Member silver trophy Adam P.'s Avatar
    Join Date
    Apr 2001
    Location
    San Francisco
    Posts
    3,288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    rollover script isn't working, can someone check the JavaScript (included)

    Hey, here's the HTML and everything.
    I checked the image names and they are all right. So why doesn't it work?


    <html>
    <head>
    <title>Staffco Services</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link rel="stylesheet" href="index2images/staffcoTEXT.css" type="text/css">

    <script language="Javascript">
    <!--
    if (document.images) {
    1up = new Image
    1over = new Image

    1up.src = 'index2images/1up.gif'
    1over.src = 'index2images/1over.gif'
    }
    //-->
    </script>

    </head>

    <body bgcolor="#FFFFFF" text="#000000" leftmargin="0">
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td valign="top" height="97" colspan="2"><img src="index2images/logo.gif" width="239" height="78"></td>
    <td width="1"></td>
    <td width="82" valign="top"> <a href="/services.html"
    onmouseover="document.thebutton.src=1over.src"
    onmouseout="document.thebutton.src=1up.src"> <img src="index2images/1up.gif" name="thebutton" border="0">
    </a></td>
    <td width="1"></td> ........



    Thanks!!
    SPF Mentor/Advisor 2001-2003
    SPF Designer of the Year 2002
    SPF Graphic Designer of the Year 2003
    AdamPolselli.com

  2. #2
    SitePoint Zealot
    Join Date
    Apr 2001
    Location
    Toronto, Ontario, Canada, Earth
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hello,

    what seems to be screwing it up is that the names of the variables start with numbers. try changing it so that they start with letters (change '1up' to 'oneup' and '1over' to 'oneover'). that should solve the problem. you should also add semi-colons to the end of the javascript commands, although it seems to work anyway without doing that.

    Jason Weinstein
    webmaster@MaximumEdge.com
    http://www.MaximumEdge.com/


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
  •