急用 js 层的显示隐藏 现在有一个需求,外面一个大层,大层里有两个小层,层1默认显示,层2默认隐藏,鼠标移动到大层上时,层2显示,层1隐藏,层2上有链接,请教各位,急用。。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <div onmouseover="javascript:document.getElementById('div1').style.display='none';document.getElementById('div2').style.display=''"><div id="div1">d</div><div id="div2" style="display:none">f</div></div> <html><script language="javascript" > function ShowDiv() { document.getElementById("div11").style.display="none"; document.getElementById("div12").style.display="block"; } function HiddDiv() { document.getElementById("div11").style.display="block"; document.getElementById("div12").style.display="none"; }</script><body><div id="div1" style="width:300px; height:300px; background-color:yellow;" onmouseover="ShowDiv();" onmouseout="HiddDiv();"><div id="div11" style="width:100px; height:300px;display:block; background-color:red;">div1</div><div id="div12" style="width:150px; height:300px;display:none; background-color:grey;"><a href="#"><span>div2</span></a></div></div></body><html> [code:html]<html><head><meta http-equiv="Content-Type" content="text/html; charset=GBK" /><title>无标题文档</title><script src="../../开发环境/jquery-1.4.2.js" type="text/javascript"></script><script type="text/javascript">function change(){ $("#a").hide(); $("#b").show();}</script></head><body> <div id="test" onMouseOver="change()" > <div id="a" > <input type="text" value="默认显示"/> </div> <div id="b"> <a href="http://www.baidu.com" >超链接</a> </div> </div></body></html>[/code] 上面弄错了 修改下发给你看<code:html><html><head><meta http-equiv="Content-Type" content="text/html; charset=GBK" /><title>无标题文档</title><script src="../../开发环境/jquery-1.4.2.js" type="text/javascript"></script><script type="text/javascript">window.onload=function(){ $("#b").hide();}function change(){ $("#a").hide(); $("#b").show();}</script></head><body> <div id="test" onMouseOver="change()" > <div id="a" > <input type="text" value="默认显示"/> </div></br> <div id="b"> <a href="http://www.baidu.com" >超链接</a> </div> </div></body></html></code> 一个form多个submit的实现问题 弹出层高度自适应 请高手帮忙 textarea的输入光标消失 但仍然能输入 有人碰到过么 Js将html转成UBB error: object expected 用appendChild方法给table加多一行的问题 浮点型数字的运算精度? 你答对我给分 如何用javascript控制文本框的输入?急! ajax 怎么捕获send 发送错误 怎样在C#里调用javascript里的函数??注意函数是带参数的 怎样不让title显示?不删除
<div id="div1">d</div>
<div id="div2" style="display:none">f</div>
</div>
<script language="javascript" >
function ShowDiv()
{
document.getElementById("div11").style.display="none";
document.getElementById("div12").style.display="block";
}
function HiddDiv()
{
document.getElementById("div11").style.display="block";
document.getElementById("div12").style.display="none";
}
</script>
<body>
<div id="div1" style="width:300px; height:300px; background-color:yellow;" onmouseover="ShowDiv();" onmouseout="HiddDiv();">
<div id="div11" style="width:100px; height:300px;display:block; background-color:red;">
div1
</div>
<div id="div12" style="width:150px; height:300px;display:none; background-color:grey;">
<a href="#"><span>div2</span></a>
</div>
</div>
</body><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
<title>无标题文档</title>
<script src="../../开发环境/jquery-1.4.2.js" type="text/javascript"></script>
<script type="text/javascript">
function change(){
$("#a").hide();
$("#b").show();
}</script>
</head><body>
<div id="test" onMouseOver="change()" >
<div id="a" >
<input type="text" value="默认显示"/>
</div>
<div id="b">
<a href="http://www.baidu.com" >超链接</a>
</div>
</div>
</body>
</html>
[/code]
<code:html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
<title>无标题文档</title>
<script src="../../开发环境/jquery-1.4.2.js" type="text/javascript"></script>
<script type="text/javascript">
window.onload=function(){
$("#b").hide();
}
function change(){
$("#a").hide();
$("#b").show();
}</script>
</head><body>
<div id="test" onMouseOver="change()" >
<div id="a" >
<input type="text" value="默认显示"/>
</div></br>
<div id="b">
<a href="http://www.baidu.com" >超链接</a>
</div>
</div>
</body>
</html>
</code>