I want to make onmouseover & onmouseout thing for my site, but I have found it hard as I don't understand JS.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="http://sc-fans.royalhosting.lv/sf.css" />
<style type="text/css">
span#btr1 {
display: block;
position: relative;
width: 151px;
height: 32px;
padding: 0px 0px 0px 0px;
background-image: url( http://sc-fans.royalhosting.lv/img/box_lr_tp.png);
background-repeat: no-repeat;
background-position: 0px 0px;
font: 12px arial narrow;
color: #000;
text-decoration: none;
background-position: center;
}
.lrbg {
text-decoration: none;
background-image: url( http://sc-fans.royalhosting.lv/img/box_lr_bg.png);
background-repeat: repeat-y;
font: 12px arial narrow;
padding-left: 3px;
padding-right: 3px;
color: #000;
background-position: center;
}
span#lt_bt {
display: block;
position: relative;
width: 151px;
height: 6px;
padding: 0px 0px 0px 0px;
background-image: url( http://sc-fans.royalhosting.lv/img/box_lr_bt.png);
background-repeat: no-repeat;
background-position: 0px 0px;
font: 12px arial narrow;
color: #000;
text-decoration: none;
background-position: center;
}
</style>
<script type="text/javascript">
function catalog_box(boxy)
{
if(boxy == 1)
document.getElementById('boxhere').innerHTML = "<td><table width="257" border='0" align="right" cellpadding="0"cellspacing="0"><tr><td><img src="http://sc-fans.royalhosting.lv/img/box_cat_tp.png"/></td></tr><tr><td class="boxbg" align="center">Text blabla blabla!</td></tr><tr><td><img src="http://sc-fans.royalhosting.lv/img/box_cat_bt.png"/></td></tr></table></td>";
else
document.getElementById('boxhere').innerHTML = "";
}
</script>
</head>
<body>
<td><table width="257" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="http://sc-fans.royalhosting.lv/img/box_cat_tp.png" alt="top" width="257" height="28" /></td>
</tr>
<tr>
<td class="boxbg" align="center"><table width="252" border="0" cellspacing="0" cellpadding="1">
<tr>
<td align="center"><img src="http://sc-fans.royalhosting.lv/img/itembox.png" onmouseover="catalog_box(1)" onmouseout="catalog_box(0)" /></td>
<td align="center"><img src="http://sc-fans.royalhosting.lv/img/itembox.png" onmouseover="catalog_box(1)" onmouseout="catalog_box(0)" /></td>
<td align="center"><img src="http://sc-fans.royalhosting.lv/img/itembox.png" onmouseover="catalog_box(1)" onmouseout="catalog_box(0)" /></td>
<td align="center"><img src="http://sc-fans.royalhosting.lv/img/itembox.png" onmouseover="catalog_box(1)" onmouseout="catalog_box(0)" /></td>
<td align="center"><img src="http://sc-fans.royalhosting.lv/img/itembox.png" onmouseover="catalog_box(1)" onmouseout="catalog_box(0)" /></td>
</tr>
<tr>
<td align="center"><img src="http://sc-fans.royalhosting.lv/img/itembox.png" onmouseover="catalog_box(1)" onmouseout="catalog_box(0)" /></td>
<td align="center"><img src="http://sc-fans.royalhosting.lv/img/itembox.png" onmouseover="catalog_box(1)" onmouseout="catalog_box(0)" /></td>
<td align="center"><img src="http://sc-fans.royalhosting.lv/img/itembox.png" onmouseover="catalog_box(1)" onmouseout="catalog_box(0)" /></td>
<td align="center"><img src="http://sc-fans.royalhosting.lv/img/itembox.png" onmouseover="catalog_box(1)" onmouseout="catalog_box(0)" /></td>
<td align="center"><img src="http://sc-fans.royalhosting.lv/img/itembox.png" onmouseover="catalog_box(1)" onmouseout="catalog_box(0)" /></td>
</tr>
</table></td>
</tr>
<tr>
<td><img src="http://sc-fans.royalhosting.lv/img/box_cat_bt.png" alt="bottom" width="257" height="11" /></td>
</tr>
</table></td>
<img src="http://sc-fans.royalhosting.lv/img/itembox.png" onmouseover="catalog_box(1)" onmouseout="catalog_box(0)" />
<did="boxhere"></div>
</body>
</html>
So I just want to create JS to show a box with information when you move mouse over this image: http://sc-fans.royal...img/itembox.png
<img src="http://sc-fans.royalhosting.lv/img/itembox.png" onmouseover='catalog_box(1)' onmouseout='catalog_box(0)' /> <did='boxhere'></div>^^ This is example, but it is not working. Nothing is working. I really don't know what are the rules and how things suppose to be to work. Could you help me out?
Actually this script is my nightmare and I don't know if script like this can work so. Oh and I start with JS only today..
Edited by pormadori, 12 April 2009 - 10:43 PM.


Sign In
Create Account


Back to top










