Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Client Side Scripting
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 09-20-2005, 11:15 AM
  #1
Robkeevil
Novice (Level 1)
 
Join Date: Sep 2005
Posts: 1
iTrader: (0)
Robkeevil is an unknown quantity at this point
Help Please!

Im currently failing trying to design a page, any help would be much appreciated!

I have a table with three cells. The top two both contain text and a "more" link, and the bottom cell is empty. Can anyone tell me a way to get a picture to appear in the bottom cell when i mouseover cell 1 (ie anywhere i cell 1, not just the link), and have it stay in place, only to be replaced with a second image if i mouse over anywhere in cell 2?

Any replies will make this javascript noob very happy!
Robkeevil is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 09-20-2005, 12:15 PM
  #2
coothead
~ bald headed old fart ~
 
coothead's Avatar
 
Join Date: Aug 2003
Location: chertsey, a small town 25 miles south west of london, england.
Posts: 7,922
iTrader: (0)
coothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to behold
Hi there Robkeevil,

and a warm welcome to these forums.

Here is a working example, it may give you some ideas....
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>mouseover cells</title>
<base href="http://coothead.homestead.com/files/"/>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<meta name="Content-Script-Type" content="text/javascript"/>
<meta name="Content-Style-Type" content="text/css"/>
<style type="text/css">
<!--
body {
     font-family:verdana,arial,helvetica,sans-serif;
     font-size:16px;
     color:#000;
     background-color:#ccc;
 }
#table1 {
     border:2px solid #999;
     margin:20px auto;
     background-color:#fff;
     color:#666;
 }
#table1 td{
     border:1px solid #666;
 }
#table1 a {
     display:block;
     width:100%;
     height:40px;
     line-height:40px;
     background-color:#fff;
     color:#000;
     text-align:center;
     text-decoration:none;
 }
#image {
     width:360px;
     height:280px;
 }
-->
</style>
<script type="text/javascript">
<!--
   var preloads=[];
function preload(){
      for(var i = 0; i < arguments.length; i ++) {
           preloads[preloads.length] = new Image();
           preloads[preloads.length - 1].src = arguments[i];
  }
}
function showPic(pic) {
     document.getElementById('image').style.backgroundImage='url('+pic+')';
 }
preload('apple.jpg','banana.jpg');
//-->
</script>

</head>
<body>

<table id="table1"><tr>

<td onmouseover="showPic('apple.jpg')">
<a href="http://www.htmlforums.com">more one</a>
</td>

<td onmouseover="showPic('banana.jpg')">
<a href="http://www.w3schools.com">more two</a>
</td>

</tr><tr>

<td colspan="2" id="image">&nbsp;</td>
</tr></table>

</body>
</html>
__________________
coothead is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart
 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 08:26 PM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.