动画不在jquery中工作 [英] animation not working in jquery

查看:95
本文介绍了动画不在jquery中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友......我有一个问题...

当我运行我的代码然后只有动画不起作用...



我的代码是..



hello friends... i have one question...
when i run my code then only animation is not working...

my code is..

$(document).ready(function () {
    $('.btn').toggle(function () {
      $(".mydiv").animate({ height:"100%" });
    },
    function () {
        $(".mydiv").animate({ height: 50 });
    });
});







和我的div代码是......




and my div code is...

 <div class="btn">
        Header 1</div>
    <div class="mydiv">
This is the content for the first header.<br />
        This is the content for the first header.<br />
        This is the content for the first header.<br />
        This is the content for the first header.<br />
        This is the content for the first header.<br />
        This is the content for the first header.<br />
        This is the content for the first header.<br />
        This is the content for the first header.<br />
        This is the content for the first header.<br />
        This is the content for the first header.<br />
        This is the content for the first header.<br />
        This is the content for the first header.<br />
        This is the content for the first header.<br />
        This is the content for the first header.<br />
    </div>
  </div>







请给我一个解决方案...

提前谢谢...




please give me a solution...
Thanks in advance...

推荐答案

(文件)。 ready(function(){
(document).ready(function () {


' 。btn' ).toggle(function(){
('.btn').toggle(function () {


。mydiv)。animate({height: 100%});
},
function(){
(".mydiv").animate({ height:"100%" }); }, function () {


这篇关于动画不在jquery中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆