一套舍不得扔的Tab方案
程序员文章站
2022-06-04 17:06:25
...
(function($){
$.fn.ltab = function(o){
var self= this;
self.title = null;
this.init = function(o){
self.find(".tabitem").click(self.showtab);
}
this.showtab = function(){
var fortab = $(this).attr("fortab");
self.find(".contents").hide();
var target = self.find("."+fortab);
if(target.size()>0){
target.show();
}
$("#diy_Tree").databind({url:"@url",par:"@par",initload:true,callf:t});
$("#analyhistory").databind({url:"@url",initload:true});
return false;
}
this.init(o);
return this;
};
})(jQuery);
<span class="tabitem" fortab="tab1" ><img src="images/left1.gif" width="32"/></span>
<span ><img src="images/left2.gif" width="32"/></span>
<span class="tabitem" fortab="tab3" ><img src="images/left3.gif" width="32"/></span>
<div id="diylib" class="contents tab2" style="display:none" url="${pageContext.request.contextPath}/patent/diylib.dhtml">
</div>
<div id="analyhistory" class="contents tab3" style="display:none" url="${pageContext.request.contextPath}/patent/analyHistory.dhtml">
</div>
上一篇: Adroid 之 Builder 对话框
下一篇: 某大厂一道笔试编程题