SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    933
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Arrow image is gone when onmouseout() is called?

    Hi, when i hover the mouse and the onmouseout() is called the image button
    is gone.

    here is the html codes from the body.
    Code:
    <body>
    <div id='pagewrap'>
    	<div id="header">  
    	  
    	</div>
    	<div id="body1">  
    	</div>
    	<div id="body2">  
    	  <div id="menudiv" style="position:absolute; left:252px; top:6px; width:519px; height:35px; z-index:2;">
    			<div id="homediv" style="position:absolute; left:3px; top:2px; width:105px; height:18px; z-index:2">
    				<a HREF="http://www.mydomain.com" onMouseover="rollOver('homeholder')" onMouseout="rollOut('homeholder')">
    					<img src="images2/home1.jpg" name="homeholder" width="120" height="30" id="homeholder" border="0"/>
    			</a>			</div>
    			<div id="girlsdiv" style="position:absolute; left:126px; top:2px; width:43px; height:16px; z-index:2">
    				<a HREF="http://www.mydomain.com" onMouseover="rollOver('girlsholder')" onMouseout="rollOut('girlsholder')">
    					<img src="images2/girls1.jpg" name="girlsholder" width="120" height="30" id="girlsholder" border="0"/>
    			</a>			</div>
    			<div id="contactdiv" style="position:absolute; left:249px; top:2px; width:40px; height:15px; z-index:2;">
    				<a HREF="http://www.mydomain.com" onMouseover="rollOver('contactholder')" onMouseout="rollOut('contactholder')">
    					<img src="images2/contact1.jpg" name="contactholder" width="140" height="30" id="contactholder" border="0"/>
    				</a>			</div>
    			<div id="bannerdiv" style="position:absolute; left:393px; top:2px; width:88px; height:11px; z-index:2">
    				<a HREF="http://www.mydomain.com" onMouseover="rollOver('bannerholder')" onMouseout="rollOut('bannerholder')">
    					<img src="images2/banner1.jpg" alt="" name="bannerholder" width="120" height="30" id="bannerholder" border="0"/>
    				</a>
    			</div>				
    	  </div>
    	</div>
    	<div align="center">
    	  <div id="body3">	  </div>
    	</div>
    
    	<div id="footer">  
    	</div> 
    </div>
    </body>
    ok, this is the javascript codes menu.js
    Code:
    // preload images
    	homeholderOff = new Image()
    	homeholderOff.src = "images2/home1.jpg"
    	homeholderOn = new Image()
    	homeholderOn.src = "images2/home2.jpg"
    
    	girlsholderOff = new Image()
    	girlsholderOff.src = "images2/girls1.jpg"
    	girlsholderOn = new Image()
    	girlsholderOn.src = "images2/girls2.jpg"
    	
    	contactholderOff = new Image()
    	contactholderOff.src = "images2/contact1.jpg"
    	contactholderOn = new Image()
    	contactholderOn.src = "images2/contact2.jpg"
    
    	bannerholderOff = new Image()
    	bannertholderOff.src = "images2/banner1.jpg"
    	bannertholderOn = new Image()
    	bannerholderOn.src = "images2/banner2.jpg"
    	
    	
    function rollOver (imgName)
    {
        document.images[imgName].src =
          eval(imgName + "On.src")
    }
    function rollOut (imgName)
    {
        document.images[imgName].src =
          eval(imgName + "Off.src")
    }
    why is it when i hover out the mouse the image button is gone?
    what do you think the problem with the codes above?

    please help...

    Thank you very much a TON in advance.

    sincerely,


    james

  2. #2
    SitePoint Member
    Join Date
    Mar 2007
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If it's the banner holder, you've got an extra T in these two lines:
    Code:
    	bannertholderOff.src = "images2/banner1.jpg"
    	bannertholderOn = new Image()
    Walk on my Path (my blog)

  3. #3
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    933
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much man!
    I'll pray to god that you will have more successful life.


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
  •