Toggle stopped working after jquery update

只谈情不闲聊 提交于 2019-12-01 11:59:47

Try this

<a href="#" id="toggler" data-show="no">Show more</a>

and

$(function() {                      
  $('#toggler').on("click",function(e) {
      if ($(this).data("show")=="no") {
        $('#tcontent').animate({height: "70"}, 800);
        $(this).data("show","yes");
      }   
      else {
        $('#tcontent').animate({height: "6"}, 800);
        $(this).data("show","no");     
      }
  });
});
$('#toggler').click( function() {
    $('#tcontent').toggle(
        function()
        {
            $(this).animate({height: "70"}, 800);
        },
        function()
        {
            $(this).animate({height: "6"}, 800);
        }
    );
});
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!