PDA

View Full Version : Mouse over not working on layer


Garyr
03-04-2013, 01:12 PM
Good afternoon I have inserted a small image of a banknote onto my site and want a rollover larger image of the banknote to appear. I have created a layer and in the behaviours box selected show on mouse over and hide on mouse out but when viewing in chrome nothig happens. Could anyone please help many thanks for your time Gary


<!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=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
#Layer1 {
position:absolute;
width:200px;
height:115px;
z-index:1;
}
#Layer2 {
position:absolute;
width:200px;
height:115px;
z-index:1;
left: 11px;
visibility: visible;
}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</script>
</head>
<body>
<img src="A1s.jpg" width="200" height="85" alt="small" longdesc="file:///C|/Users/Gary/Documents/Banknote website/Images/Afganistan/A1s.jpg" />
<div id="Layer2" onmouseover="MM_showHideLayers('Layer2','','show')" onmouseout="MM_showHideLayers('Layer2','','hide')"><img src="A1.jpg" alt="large" width="650" height="276" longdesc="file:///C|/Users/Gary/Documents/Banknote website/Images/Afganistan/A1.jpg" onmouseover="MM_showHideLayers('Layer2','','hide')" onmouseout="MM_showHideLayers('Layer2','','show')" /></div>
</body>
</html>

Garyr
03-04-2013, 01:52 PM
I have worked out the problem i have attached the show/hide details to the wrong image which i have now corrected. When previewing in chrome the larger layer appears and squashes up the remaining information in the table is there a way I can have a mouse over that shows a larger image of the note and keeps the rest of the website stationary ? many thanks gary

edbr
03-05-2013, 01:10 AM
you are using tables for layout?

Garyr
03-05-2013, 07:50 AM
Hi thanks for your reply, yes I was using a table as I am selling banknotes and wanted to put a small picture on the far left and then text in the middle then a buy button on the right and continue this down the page for each country. Can you recommend a better way of doing this rather than a table? Your help is much appreciated Thanks Gary