开发者

animate a div to a specific value with slideToggle() (more/less function)

<script>
$(document).ready(function(){
$("a").click(function(){
$("div").slideToggle("slow");
});
});
</script>

<div style="height:240px; width:320px; border:1px solid tan; background:beige; padding:10px">text</div>
<a href=javascript:;>more/le开发者_Python百科ss</a>

hi coder, i want to toogle a div from 80px/320px to 240px/320px with animate. is this possible with slideToggle() or do i need an own function? best regards


You can use toggleClass() and pass in a number for the speed of animation.

jsFiddle.

Keep in mind this requires jQuery UI.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜