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

    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();
        });
    }
  • 相关阅读:
    js打印指定元素内容
    c# RedisHelper
    T4生成整理
    T4随记
    c# 文本超长截断
    mysql自动安装教程说明
    完全卸载mysql免安装版
    解决WebClient或HttpWebRequest首次连接缓慢问题
    c# 停靠窗体
    c#透明panel
  • 原文地址:https://www.cnblogs.com/as3lib/p/6687831.html
Copyright © 2011-2022 走看看