手机
当前位置:查字典教程网 >编程开发 >php教程 >jquery不支持toggle()高(新)版本的问题解决
jquery不支持toggle()高(新)版本的问题解决
摘要:在js代码中引入以下代码,让高版本的jquery兼容toggle事件。代码如下:/***Replacementfortoggle*/jQue...

在js代码中引入以下代码,让高版本的jquery兼容toggle事件。代码如下:

/** * Replacement for toggle */ jQuery.fn.toggle = function( fn, fn2 ) { // Don't mess with animation or css toggles if ( !jQuery.isFunction( fn ) || !jQuery.isFunction( fn2 ) ) { return oldToggle.apply( this, arguments ); } // Save reference to arguments for access in closure var args = arguments, guid = fn.guid || jQuery.guid++, i = 0, toggler = function( event ) { // Figure out which function to execute var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); // Make sure that clicks stop event.preventDefault(); // and execute the function return args[ lastToggle ].apply( this, arguments ) || false; }; // link all the functions, so any of them can unbind this click handler toggler.guid = guid; while ( i < args.length ) { args[ i++ ].guid = guid; } return this.click( toggler ); };

以上就是jquery不支持toggle()高(新)版本的问题解决的资料,希望能帮助到大家,谢谢大家对本站的支持!

【jquery不支持toggle()高(新)版本的问题解决】相关文章:

WinXP + Apache +PHP5 + MySQL + phpMyAdmin安装全功略

用php写的serv-u的web申请账号的程序

关于PHP中操作MySQL数据库的一些要注意的问题

Oracle 常见问题解答

用cookies来跟踪识别用户

我的论坛源代码(一)

JAVA/JSP学习系列之六

php分别做为cgi和module来运行的配置

PHP和JAVA的XML-RPC中文问题解决办法

php猴子选大王问题解决方法

精品推荐
分类导航