jQuery的slideToggle方法实例
2018-10-12 14:03
253 查看
<title></title>
<style type="text/css">
.imgclass{ width:300px; height:300px; border:solid 1px red;}
</style>
<script src="jquery-1.9.1.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$('#Button1').bind('click', function () {
$('img').slideUp(2000);
})
$('#Button2').bind('click', function () {
$('img').slideDown(2000);
})
$('#Button3').bind('click', function () {
$('img').slideToggle(2000);
})
})
</script>
</head>
<body>
<div>
<div>
<input id="Button1" type="button" value="上拉" /><input id="Button2" type="button" value="下拉" /><input id="Button3" type="button" value="自动上拉下拉" /></div>
<div><img src="images/1.jpg" class="imgclass"/></div>
</div>
</body>
相关文章推荐
- jQuery的slideToggle方法实例
- Jquery FadeIn,FadeOut,toggle,slideToggle的使用方法实例
- jQuery-源码阅读,extend()与工具方法、实例方法
- jQuery中使用data()方法读取HTML5自定义属性data-*实例
- jQuery中position()方法用法实例
- jQuery中delegate()方法用法实例
- JQuery选中checkbox方法代码实例(全选、反选、全不选)
- jQuery中eq()方法用法实例
- jQuery源码学习之三 (jQUery对象的实例属性和方法)
- jquery 连写注释;siblings() 方法;jQuery 的3种滑动方法;slideUp()向上滑动;slideDown()向下滑动;slideToggle()来回滑动
- jQuery中removeClass()方法用法实例
- 在JavaScript中重写jQuery对象的方法实例教程
- 模拟jQuery中的ready方法及实现按需加载css,js实例代码
- jQuery中使用data()方法读取HTML5自定义属性data-*实例
- jQuery中contents()方法用法实例
- JQueryiframe页面操作父页面中的元素与方法(实例讲解)
- jQuery中width()方法用法实例
- jQuery中width()方法用法实例