欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

一套舍不得扔的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>
相关标签: jQuery HTML