一、jQuery效果-滑动
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title></title> <script class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="jquery-1.10.1.min.js"></script> <script class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="move.js"></script> <style> #content,#flipShow,#flipHide,#flipToggle{ padding: 5px; text-align: center; background-color: red; border: solid 1px green; } #content{ display: none; padding: 50px; } </style> </head> <body> <div id="flipShow">出现</div> <div id="flipHide">隐藏</div> <div id="flipToggle">显示/隐藏</div> <div id="content">Hello World</div> </body></html>$(document).ready(function(){ $("#flipShow").click(function(){ $("#content").slideDown(1000); }); $("#flipHide").click(function(){ $("#content").slideUp(1000); }); $("#flipToggle").click(function(){ $("#content").slideToggle(500); });});
二、jQuery效果-回调
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title></title> <script class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="jquery-1.10.1.min.js"></script> <script class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="callback.js"></script> </head> <body> <button>隐藏</button> <p>Hello WorldHello WorldHello WorldHello WorldHello WorldHello World</p> </body></html>$(document).ready(function(){ $("button").click(function(){// $("p").hide(1000,function(){// alert("动画结束,这个方法称为被回调");// }); $("p").css("color","red").slideUp(1000).slideDown(1000); });});
点击查看更多内容
为 TA 点赞
评论
共同学习,写下你的评论
评论加载中...
作者其他优质文章
正在加载中
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦