SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  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 workin', 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>
    SPF Mentor/Advisor 2001-2003
    SPF Designer of the Year 2002
    SPF Graphic Designer of the Year 2003
    AdamPolselli.com

  2. #2
    SitePoint Enthusiast slp's Avatar
    Join Date
    May 2001
    Location
    Australia
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    With a little help from Netscape's script error reporting, I think I know why it isn't working. It doesn't seem to like the names you've chosen for your image files. Specifically, starting them with a number. For example, if you replace 1up with up1 and 1over with over1 it all works fine.

  3. #3
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That is one of the few things that Netscape is good for. It's Javascript debugger is quite helpful.

    If you have Netscape (and you SHOULD if you design for the web) then simply type javascript: (all one word, WITH the colon) into the address bar and it will launch the debugger.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  4. #4
    SitePoint Enthusiast slp's Avatar
    Join Date
    May 2001
    Location
    Australia
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd be lost without it!


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
  •