网站开发 手把手好的app设计网站
网站开发 手把手,好的app设计网站,vultr 做网站空间,jsp网站开发与数据库连接一、显隐效果show() show(duration,[callback])show([duration],[easing],[callback])
参数说明#xff1a;duration#xff1a;为一个字符串或者数字#xff0c;决定动画将运行多久callback#xff1a;表示在动画完成时执行的函数。easing#xff1a;为一个字符串#x…一、显隐效果show() show(duration,[callback])show([duration],[easing],[callback])
参数说明duration为一个字符串或者数字决定动画将运行多久callback表示在动画完成时执行的函数。easing为一个字符串用来表示哪个缓冲区来过渡。(没用过....)案例
htmlheadtitleJQuery/titlestyle#p1{background:url(imgliu/photo6.png);background-position: center;background-size: cover;background-repeat: no-repeat;width: 50px;height: 50px;}/stylescript typetext/javascript srcjs/jquery-3.2.1.min.js/script/headbodyscript$(function(){var t1;$(input).click(function(){t;if(t%20){$(div).show(500);}else{$(div).hide(500);}})});/scriptinput typebutton valuehide Element div idp1/div/body
/html
htmlheadtitleJQuery/titlestylediv{background:url(imgliu/photo6.png);background-position: center;background-size: cover;background-repeat: no-repeat;width: 50px;height: 50px;float: left;margin-left: 30px;}/stylescript typetext/javascript srcjs/jquery-3.2.1.min.js/script/headbodyscript$(function(){for(var i0;i5;i){$(div).appendTo(document.body);}$(div).click(function(){$(this).hide(500,function(){$(this).remove();});});});/scriptdiv/div/body
/html二、显隐切换toggle([duration],[callback])toggle([duration],[easing],[callback])toggle(showOrHide)
参数说明showOrHide:是一个布尔值表示是否显示或隐藏的元素。
htmlheadtitleJQuery/titlestylediv{background:url(imgliu/photo6.png);background-position: center;background-size: cover;background-repeat: no-repeat;width: 50px;height: 50px;margin-left: 30px;}/stylescript typetext/javascript srcjs/jquery-3.2.1.min.js/script/headbodyscript$(function(){$(button).click(function(){$(div).toggle(slow);})})/scriptbutton显示和隐藏/buttondiv/div/body
/html
三、滑动效果
滑动方法slideDown() //向下滑动作用于隐藏的元素slideUp()//向上滑动作用于显示的元素实例
htmlheadtitle/titlescript typetext/javascript srcjs/jquery-3.2.1.min.js/script/headbodyscript$(function(){$(button).click(function(){$(this).parent().slideUp(slow,function(){$(#msg).text($(button,this).text()已经实现。);});});});/scriptstyle typetext/cssdiv{margin: 2px;}/styledivbutton隐藏文本框1/buttoninput typetext value文本框1 //divdivbutton隐藏文本框2/buttoninput typetext value文本框2 //divdivbutton隐藏文本框3/buttoninput typetext value文本框3/divdiv idmsg/div/body
/html
四、滑动切换slideToggle([duration],[callback])slideToggle([durantion],[easing],[callback])
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/pingmian/89791.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!