如何用JS实现一个效果 我点按钮第一下的时候,显示下面隐藏的DIV,我再点就把DIV隐藏起来了,再去点,他也就打开了!要滑动门效果!求一段代码~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用jQuery来写吧,http://api.jquery.com/toggle/更复杂的效果可以使用jQueryUI插件:http://jqueryui.com/demos/toggle/#default <!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>无标题文档</title><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script><script type="text/javascript">$(document).ready( function() { $("#btn").click( function() { $(".d1").toggle('fast'); });});</script></head><body><input type="button" id="btn" value="按钮" /><div class="d1" style="width:200px; border:1px solid #999; background-color:#39F; color:#FFF; display:none;">我点按钮第一下的时候,显示下面隐藏的DIV,我再点就把DIV隐藏起来了,再去点,他也就打开了!要滑动门效果!求一段代码~</div></body></html> //假如按钮id为btn1,div的id为div1<script>$(function(){ $("#btn1").click( function(){ $("#div").toggle(); })})</script> js根据判断条件显示图片 struts 与 jquery ext的一个问题(急啊。谢谢了) addClass加载类,加载的类在创建时为什么一定要写成 #(id名).(class类名); 而直接写 .(class类名)就不能被调用 相同js代码,不同空间有不同结果,为什么? 请fanson等人内进! 一个下载保存的问题 求链接特效 如何实现双下拉列表? 简单问题 一个小问题:怎样将字符串转换为操作符 今天交项目,求助EXT高手 JSChart 后台返回的数据怎么放到Array里
更复杂的效果可以使用jQueryUI插件:http://jqueryui.com/demos/toggle/#default
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready( function() {
$("#btn").click( function() { $(".d1").toggle('fast'); });
});
</script>
</head><body>
<input type="button" id="btn" value="按钮" />
<div class="d1" style="width:200px; border:1px solid #999; background-color:#39F; color:#FFF; display:none;">
我点按钮第一下的时候,显示下面隐藏的DIV,我再点就把DIV隐藏起来了,再去点,他也就打开了!要滑动门效果!求一段代码~
</div>
</body>
</html>
//假如按钮id为btn1,div的id为div1<script>
$(function(){
$("#btn1").click(
function(){
$("#div").toggle();
})
})
</script>