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();
    });
}

jquery 1.9里面已经删除了toggle(fn1, fn2)函数:的更多相关文章

  1. jquery 1.9里面已经删除了toggle(fn1, fn2)函数

    转自:http://blog.sina.com.cn/s/blog_50042fab0101c7a9.html jquery 1.9里面已经删除了toggle(fn1, fn2)函数: 引用 Note ...

  2. ThinkPHP第二十一天(JQuery元素获取,parents属性,toggle方法,确认弹出对话框使用)

    1.JQuery用法 A:$(function(){code...});表示当页面载入完毕后执行 B:获取元素方法:根据class名称 $('.classname'),根据ID名称 $('#IDnam ...

  3. JQuery获取元素宽度.width()与.css(‘width’)两个函数的区别

    整理翻译自:http://blog.jquery.com/2012/08/16/jquery-1-8-box-sizing-width-csswidth-and-outerwidth/ 大意是: 在J ...

  4. jQuery元素属性attr设置多个键值或函数 删除属性removeAttr

    $("Element").attr(name) '取得第一个匹配的属性值,比如$("img").attr("src") $("El ...

  5. jQuery 源码解析(八) 异步队列模块 Callbacks 回调函数详解

    异步队列用于实现异步任务和回调函数的解耦,为ajax模块.队列模块.ready事件提供基础功能,包含三个部分:Query.Callbacks(flags).jQuery.Deferred(funct) ...

  6. jquery 1.9以上新版本不支持toggle()的解决方法

    原文:http://blog.csdn.net/u011061889/article/details/50397462 参考: http://www.cnblogs.com/lionden/archi ...

  7. 关于jQuery中toggle参数callback函数提前执行问题

    通过 jQuery,您可以使用 toggle() 方法来切换 hide() 和 show() 方法. 显示被隐藏的元素,并隐藏已显示的元素: $(selector).toggle(speed,call ...

  8. jQuery 2.0.3 源码分析Sizzle引擎 - 编译函数(大篇幅)

    声明:本文为原创文章,如需转载,请注明来源并保留原文链接Aaron,谢谢! 从Sizzle1.8开始,这是Sizzle的分界线了,引入了编译函数机制 网上基本没有资料细说这个东东的,sizzle引入这 ...

  9. jQuery数组($.each,$.grep,$.map,$.merge,$.inArray,$.unique,$.makeArray)处理函数详解

    1. $.each(array, [callback]) 遍历[常用] 解释: 不同于例遍jQuery对象的$().each()方法,此方法可用于例遍任何对象.回调函数拥有两个参数:第一个为对象的成员 ...

随机推荐

  1. iOS UI-常用控件

    #import "ViewController.h" @interface ViewController ()<UITextFieldDelegate> // 标题标签 ...

  2. Logger.getLogger()和LogFactory.getLog()的区别

    第一.Logger.getLogger()和LogFactory.getLog()的区别 1.Logger.getLogger()是使用log4j的方式记录日志: 2.LogFactory.getLo ...

  3. Vysor安装图解

    Vysor安装图解   11 准备东西       路径 C:\Users\Administrator\AppData\Local\Google\Chrome\User Data\Default   ...

  4. customization arm ubuntu rootfs

    requirment: want to get arm ubuntu rootfs method: base on debootstrap tool, customization full funct ...

  5. 快速切题 sgu105. Div 3 数学归纳 数位+整除 难度:0

    105. Div 3 time limit per test: 0.25 sec. memory limit per test: 4096 KB There is sequence 1, 12, 12 ...

  6. CF 463A && 463B 贪心 && 463C 霍夫曼树 && 463D 树形dp && 463E 线段树

    http://codeforces.com/contest/462 A:Appleman and Easy Task 要求是否全部的字符都挨着偶数个'o' #include <cstdio> ...

  7. ECharts报表的使用

    知道你们懒得手打网址,给你们贴上:http://echarts.baidu.com/echarts2/ 1.下载并解压之后,找到echarts-2.2.7\build\dist\echarts-all ...

  8. call、apply的应用

    call方法: 语法:call([thisObj[,arg1[, arg2[,   [,.argN]]]]]) 定义:调用一个对象的一个方法,以另一个对象替换当前对象. 说明: call 方法可以用来 ...

  9. iOS调用第三方地图App进行导航方法

    前言 App内根据手机上装载的地图App将其显示在弹出的选择框,选择对应地图跳转进入地图导航.需要用到- (BOOL)canOpenURL:(NSURL *)url NS_AVAILABLE_IOS( ...

  10. BeanFactory工厂

    Core模块主要的功能是实现了反向控制(Inversion of Control)与依赖注入(Denpendency Injection).Bean配置以及加载. Beans为Spring里的各种对象 ...