最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

jquery不支持toggle()高(新)版本的問(wèn)題解決

 更新時(shí)間:2016年09月24日 10:25:13   投稿:lqh  
這篇文章主要介紹了jquery不支持toggle()高(新)版本的問(wèn)題解決的相關(guān)資料,需要的朋友可以參考下

在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()高(新)版本的問(wèn)題解決的資料,希望能幫助到大家,謝謝大家對(duì)本站的支持!

相關(guān)文章

最新評(píng)論

应用必备| 栾川县| 兴海县| 探索| 新民市| 阿克陶县| 崇左市| 萨嘎县| 开原市| 武乡县| 赤壁市| 鄱阳县| 星子县| 湄潭县| 大冶市| 临海市| 东辽县| 孟连| 澎湖县| 山西省| 永靖县| 家居| 中山市| 拜泉县| 承德市| 工布江达县| 梓潼县| 偏关县| 常宁市| 和田县| 太仆寺旗| 忻城县| 临泽县| 杭锦后旗| 南宁市| 彭阳县| 屏边| 密山市| 芜湖市| 临沧市| 本溪|