加上onMouseOver="Layer1.style.visibility='visible'" onMouseOut="Layer1.style.visibility='hidden'"如下<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript" type="text/JavaScript">
<!--
function onmo()
{ if(((window.event.clientX + document.body.scrollLeft) > Layer1.offsetLeft)
&& ((window.event.clientX + document.body.scrollLeft)
< (Layer1.offsetLeft + Layer1.offsetWidth))
&& ((window.event.clientY + document.body.scrollTop) > Layer1.offsetTop)
&& ((window.event.clientY + document.body.scrollTop)
< (Layer1.offsetTop + Layer1.offsetHeight)))
{
//table.style.BACKGROUND-COLOR:="red"
} }
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head><body>
<div id="Layer1" style="position:absolute; left:207px; top:12px; width:363px; height:167px; z-index:1; visibility: hidden;" onMouseOver="Layer1.style.visibility='visible'" onMouseOut="Layer1.style.visibility='hidden'">
<table width="100%" border="1" id="table">
<tr>
<td height="162" bgcolor="#FFCC33"><font size="+6">ladytron</font></td>
</tr>
</table>
</div>
<a href="1" onMouseOver="Layer1.style.visibility='visible'"><img src="test.jpg" width="181" height="194" border="0" ></a>
</body>
</html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript" type="text/JavaScript">
<!--
function onmo()
{ if(((window.event.clientX + document.body.scrollLeft) > Layer1.offsetLeft)
&& ((window.event.clientX + document.body.scrollLeft)
< (Layer1.offsetLeft + Layer1.offsetWidth))
&& ((window.event.clientY + document.body.scrollTop) > Layer1.offsetTop)
&& ((window.event.clientY + document.body.scrollTop)
< (Layer1.offsetTop + Layer1.offsetHeight)))
{
//table.style.BACKGROUND-COLOR:="red"
} }
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head><body>
<div id="Layer1" style="position:absolute; left:207px; top:12px; width:363px; height:167px; z-index:1; visibility: hidden;" onMouseOver="Layer1.style.visibility='visible'" onMouseOut="Layer1.style.visibility='hidden'">
<table width="100%" border="1" id="table">
<tr>
<td height="162" bgcolor="#FFCC33"><font size="+6">ladytron</font></td>
</tr>
</table>
</div>
<a href="1" onMouseOver="Layer1.style.visibility='visible'"><img src="test.jpg" width="181" height="194" border="0" ></a>
</body>
</html>
大家可不可以继续帮帮我,为何判断鼠标运动的那个函数无效的阿?!
我在javascript里面的参数中需要如何改呢?
因为我生成的每一个div中需要显示的东西都不相同
如果你div中的东西不复杂,做一个共用层动态改变其中的innerHTML不可以吗?
都是动态读出来的,每一个div中内容不一样,请问csdntzg兄,如何使用innerHTML呀?
刚开始写一些php和javascript的东西,经验不足,请教各位了。
爵士mm不好意思占用了你的帖子了
在保证前面javascript正确的前提下:
我希望点在不同链接上,出现的div的内容不同,还是不太会用innerHTML,但我感觉这是一个
有效的办法,csdntzg能给点代码之类的让我学习学习麽,要是能帮我根据我这个代码改改
那就最好了:)多谢了
<?
for($i=0;$i<10;$i++){
echo '<a href="1" onMouseOver="'."Layer1.style.visibility="."'visible'".'">'."$i</a><br>";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
}echo '<div id="'."Layer1".'" style="'.'position:absolute; left:15px; top:15px; width:363px; height:167px; z-index:1; visibility: hidden;'.'" onMouseOver="'."Layer1.style.visibility="."'visible'".'" onMouseOut="'."Layer1.style.visibility="."'hidden'".'">';
echo "<table width=160 border=0 id=table>";
echo "<tr>";
echo "<td height=160 width=200 bgcolor=#99ccff><font size=3>";
echo " Start From:$i“;
~~~~~~~~~~~~~~~~~~~~~~~~~
echo "</font></td>";
echo "</tr>";
echo "</table>";
echo "</div>"
?>
然后在图片和层上都加上onmouseover和onmouseout就可以了floppyking试试这个如何<html>
<head>
<script language="JavaScript" type="text/JavaScript">
<!--
function show(cont) { //v2.0
lynote.style.visibility="visible";
lynote.innerHTML=cont;
lynote.style.left=event.x+10;
lynote.style.top=event.y+15;
}
//-->
</script>
</head>
<body>
<table width="685" border="1">
<tr>
<td width="90">1</td>
<td width="550"><a href="a" onMouseMove="show(this.innerText);" onMouseOut="lynote.style.visibility='hidden'">aaaaaaaa</a></td>
</tr>
<tr>
<td>2</td>
<td><a href="b" onMouseMove="show(this.innerText);" onMouseOut="lynote.style.visibility='hidden'">bbbbbbbbb</a></td>
</tr>
<tr>
<td>3</td>
<td><a href="c" onMouseMove="show(this.innerText);" onMouseOut="lynote.style.visibility='hidden'">cccccccccc</a></td>
</tr>
</table>
<div id="lynote" style="position:absolute; width:195px; height:14px; z-index:1; background-color: #00CCFF; layer-background-color: #00CCFF; border: 1px none #000000; visibility: hidden;"></div>
</body>
</html>
我该怎么给你们分呢:(