zoukankan      html  css  js  c++  java
  • jquery 1.9里面已经删除了toggle(fn1, fn2)函数

    转自:http://blog.sina.com.cn/s/blog_50042fab0101c7a9.html

    jquery 

    1.9里面已经删除了toggle(fn1, fn2)函数:
    引用
    Note: This method signature was deprecated in jQuery 1.8 and removed in jQuery 
    1.9. jQuery also provides an animation method named .toggle() that toggles the 
    visibility of elements. Whether the animation or the event method is fired depends on 
    the set of arguments passed.

    要用的话可以引用1.9以下的jquery,或者写一个替代
    var flag=1;
        $(".selector").click(function(){
            if(flag==1){
                //执行方法;
                flag=0;
            }else{
                //执行方法;
                flag=1;
            }
    或者外接函数,例如
    toggle(objs) {
        $(objs).each(function(){
            if ($(this).is(':hidden')) $(this).show(); else $(this).hide();
        });
    }
  • 相关阅读:
    内存
    jmeter设置全局变量
    tomcat(1)
    JVM(一)
    内存溢出
    消息中间件
    上下文切换(二)
    平均负载(二)
    requests模块
    Pycharm如何配置Git
  • 原文地址:https://www.cnblogs.com/haha12/p/4737049.html
Copyright © 2011-2022 走看看