$(function() {
        $("#target").click(function(){
            var togglearea = $(this);
            if(!togglearea.next().is(":animated")){//Used to judge the animation is implementing or not
                //This if statement is used to make the animation is more smooth, if the toggled class didn't have any css style related to marign or padding, you can just use the first if statement.
                if(togglearea.attr("class")=="origin"){
                    togglearea.toggleClass("origin").next().slideToggle("slow");
                }
                else{
                    togglearea.next().slideToggle("slow", function(){togglearea.toggleClass("origin");});
                }
            }
            return false;
        });
    });

相关文章:

  • 2022-02-05
  • 2021-12-03
  • 2021-04-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-27
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-03
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2022-02-01
  • 2022-12-23
  • 2021-05-17
相关资源
相似解决方案