速度结贴——点击按钮时,按钮下方弹出一个层,用jquery实现 点击一个按钮时下面弹出一个层,在点时层就收起来。最好是jquery代码实现。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 先把要显示的层做好 初始化的时候隐藏调用的时候再显示btn.onclick=function(){ document.getElementById("div1").style.display="";} 这不就是手风琴效果!网上多的是,要实现这种效果,你写得html代码就要有一定的规律。不要老总是想要现成的,有时候多想象,多查查,不懂的也懂了!http://download.csdn.net/source/2036848自己下....... <html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>无标题页</title> <script src="../publ/JS/jquery-1.3.min.js" type="text/javascript"></script> <script> $(document).ready(function() { }); function hiden() { $("#divObj").hide(); } function show() { $("#divObj").show(); //显示,参数说明同上 } </script></head><body> <form id="form1" runat="server"> <input type="button" value="隐藏" onclick="hiden()" /> <input type="button" value="显示" onclick="show()" /> <div id="divObj" style="display:none;"> hello world!</div> </form></body></html> <script type="text/javascript"> function display(div){$(div).style.display=($(div).style.display=="none")?"":"none";} function $(obj){return document.getElementById(obj);} </script> 也可以一个按钮解决,如:<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>无标题页</title> <script src="../publ/JS/jquery-1.3.min.js" type="text/javascript"></script> <script> $(document).ready(function() { $("#Button1").click(function() { if ($(this).val() == "显示") { $("#divObj").show(); $(this).val("隐藏"); } else { $("#divObj").hide(); $(this).val("显示"); } }) }) </script> </head><body> <form id="form1" runat="server"> <input id="Button1" type="button" value="显示" /> <div id="divObj" style="display:none;"> hello world!</div> </form></body></html> $(document).ready(function() { $("#btnShow").toggle( function () { $(("#divContent").addClass("hideClass"); }, function () { $(("#divContent").removeClass("hideClass"); } ); }); 或jquery hide() & show() 让整个页面居中 微缩图片 方案 .NET无法创建ActiveX组件-----急,求救啊..... 请需要c#全站程序和mis oa程序的网友进来看看 高分求高手转几行asp代码。 在DataGrid控件中,以下代码在一个页面中可以,而在另一个页面却不行,真是百思不得其解? 想问一下OA系统的版式问题。 C#里如何让尺寸太大的图片自动缩小? 求教高手关于反序列化失败问题 急需解决!留言插入数据库看不到。 网站用到了com组件。但是web程序执行时。没有权限执行。该怎样设置呢。 请教FTP的问题,请大家帮帮忙~
调用的时候再显示
btn.onclick=function(){
document.getElementById("div1").style.display="";
}
自己下.......
<head runat="server">
<title>无标题页</title> <script src="../publ/JS/jquery-1.3.min.js" type="text/javascript"></script>
<script>
$(document).ready(function() { });
function hiden() {
$("#divObj").hide();
}
function show() {
$("#divObj").show(); //显示,参数说明同上
} </script></head>
<body>
<form id="form1" runat="server">
<input type="button" value="隐藏" onclick="hiden()" />
<input type="button" value="显示" onclick="show()" />
<div id="divObj" style="display:none;">
hello world!</div>
</form>
</body>
</html>
<script type="text/javascript">
function display(div){$(div).style.display=($(div).style.display=="none")?"":"none";} function $(obj){return document.getElementById(obj);} </script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
<script src="../publ/JS/jquery-1.3.min.js" type="text/javascript"></script>
<script>
$(document).ready(function() {
$("#Button1").click(function() {
if ($(this).val() == "显示") {
$("#divObj").show();
$(this).val("隐藏");
}
else {
$("#divObj").hide();
$(this).val("显示");
}
})
})
</script>
</head>
<body>
<form id="form1" runat="server">
<input id="Button1" type="button" value="显示" />
<div id="divObj" style="display:none;"> hello world!</div>
</form>
</body>
</html>
{
$("#btnShow").toggle(
function () {
$(("#divContent").addClass("hideClass");
},
function () {
$(("#divContent").removeClass("hideClass");
}
);
});
或jquery hide() & show()