• 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();
        });
    }
  • 相关阅读:
    PHP touch() 函数
    PHP tmpfile() 函数
    PHP tempnam() 函数
    PHP symlink() 函数
    PHP stat() 函数
    pt-table-sync
    P4233 射命丸文的笔记
    C# Task.Run 和 Task.Factory.StartNew 区别
    C# Task.Run 和 Task.Factory.StartNew 区别
    SourceYard 制作源代码包
  • 原文地址:https://www.cnblogs.com/haha12/p/4737049.html
Copyright © 2020-2023  润新知