亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

H+ 框架contab.min.js 功能實現

H+ 框架contab.min.js 功能實現

$(function(){ ????function?f(l){ ????????var?k=0; ????????$(l).each(function(){ ????????????k+=$(this).outerWidth(true) ????????}); ????????return?k ????} ????function?g(n){ ????????var?o=f($(n).prevAll()),q=f($(n).nextAll()); ????????var?l=f($(".content-tabs").children().not(".J_menuTabs")); ????????var?k=$(".content-tabs").outerWidth(true)-l; ????????var?p=0; ????????if($(".page-tabs-content").outerWidth()<k){ ????????????p=0}else{if(q<=(k-$(n).outerWidth(true)-$(n).next().outerWidth(true))){ ????????????????if((k-$(n).next().outerWidth(true))>q){ ????????????????????p=o; ????????????????????var?m=n; ????????????????????while((p-$(m).outerWidth())>($(".page-tabs-content").outerWidth()-k)){ ????????????????????????p-=$(m).prev().outerWidth(); ????????????????????????m=$(m).prev() ????????????????????} ????????????????} ????????????} ????????????else{ ????????????????if(o>(k-$(n).outerWidth(true)-$(n).prev().outerWidth(true))){ ????????????????????p=o-$(n).prev().outerWidth(true) ????????????????} ????????????} ????????} ????????$(".page-tabs-content").animate({marginLeft:0-p+"px"},"fast") ????} ????function?a(){ ????????var?o=Math.abs(parseInt($(".page-tabs-content").css("margin-left"))); ????????var?l=f($(".content-tabs").children().not(".J_menuTabs")); ????????var?k=$(".content-tabs").outerWidth(true)-l; ????????var?p=0; ????????if($(".page-tabs-content").width()<k){ ????????????return?false ????????} ????????else{ ????????????var?m=$(".J_menuTab:first"); ????????????var?n=0; ????????????while((n+$(m).outerWidth(true))<=o){ ????????????????n+=$(m).outerWidth(true);m=$(m).next() ????????????} ????????????n=0; ????????????if(f($(m).prevAll())>k){ ????????????????while((n+$(m).outerWidth(true))<(k)&&m.length>0){ ????????????????????n+=$(m).outerWidth(true);m=$(m).prev() ????????????????} ????????????????p=f($(m).prevAll()) ????????????} ????????} ????????$(".page-tabs-content").animate({marginLeft:0-p+"px"},"fast") ????} ????function?b(){ ????????var?o=Math.abs(parseInt($(".page-tabs-content").css("margin-left"))); ????????var?l=f($(".content-tabs").children().not(".J_menuTabs")); ????????var?k=$(".content-tabs").outerWidth(true)-l; ????????var?p=0; ????????if($(".page-tabs-content").width()<k){ ????????????return?false ????????} ????????else{ ????????????var?m=$(".J_menuTab:first"); ????????????var?n=0;while((n+$(m).outerWidth(true))<=o){ ????????????????n+=$(m).outerWidth(true); ????????????????m=$(m).next()}n=0; ????????????????while((n+$(m).outerWidth(true))<(k)&&m.length>0){ ????????????????????n+=$(m).outerWidth(true); ????????????????????m=$(m).next()}p=f($(m).prevAll()); ????????????????????if(p>0){$(".page-tabs-content").animate({ ????????????????????????marginLeft:0-p+"px" ????????????????????},"fast") ????????????????} ????????????} ????????} ????????$(".J_menuItem").each(function(k){ ????????????if(!$(this).attr("data-index")){ ????????????????$(this).attr("data-index",k) ????????????} ????????}); ????????function?c(){ ????????????var?o=$(this).attr("href"),m=$(this).data("index"),l=$.trim($(this).text()),k=true; ????????????if(o==undefined||$.trim(o).length==0){ ????????????????return?false ????????????} ????????????$(".J_menuTab").each(function(){ ????????????????if($(this).data("id")==o){ ????????????????????if(!$(this).hasClass("active")){ ????????????????????????$(this).addClass("active").siblings(".J_menuTab").removeClass("active"); ????????????????????????g(this);$(".J_mainContent?.J_iframe").each(function(){ ????????????????????????????if($(this).data("id")==o){ ????????????????????????????????$(this).show().siblings(".J_iframe").hide(); ????????????????????????????????return?false ????????????????????????????} ????????????????????????}) ????????????????????} ????????????????????k=false; ????????????????????return?false ????????????????} ????????????}); ????????????if(k){ ????????????????var?p='<a?href="javascript:;"?class="active?J_menuTab"?data-id="'+o+'">'+l+'?<i?class="fa?fa-times-circle"></i></a>'; ????????????????$(".J_menuTab").removeClass("active"); ????????????????var?n='<iframe?class="J_iframe"?name="iframe'+m+'"?width="100%"?height="100%"?src="'+o+'"?frameborder="0"?data-id="'+o+'"?seamless></iframe>'; ????????????????$(".J_mainContent").find("iframe.J_iframe").hide().parents(".J_mainContent").append(n); ????????????????$(".J_menuTabs?.page-tabs-content").append(p);g($(".J_menuTab.active")) ????????????} ????????????return?false ????????} });已經整理好,求大神大致講一下意思
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 4075 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號