|
这个选项卡不是一个单独的选项卡,而是多个选项卡,每个选项卡里面有多个选项,而且选项的个数也不一样。废话不多说,直接上jquery代码。
[code=JavaScript width=600px]<script type="text/javascript">
$(function() {
$(".designerspanel").each(function(){
$(this).find(".tabspanel #show:not(:first)").hide();
});
$(".designerspanel li").click(function(){
idname=$(this).parents('.designerspanel').attr('id');
current=$("#"+idname+" li:eq(0)").attr('class');
current=current.replace("black","");
$("#"+idname+" li").addClass("black");
$(this).removeClass("black").addClass(current);
$("#"+idname+" #show").hide();
$("#"+idname+" #show").eq($("#"+idname+" li").index(this)).show();
}).css("cursor", "pointer");
})
</script>[/code]
附上html代码
[code=Xml width=600px]class="designernamelist">
<!--{foreach from=$C item=i}-->
<a href="#">{$i.user_name}</a>
<!--{/foreach}-->
</div>
<div class="namespanelpage1"></div>
</div>
<div class="imgspanel"></div>
<div class="imgspanel"></div>
</div>
<div id="show">
<div class="namespanel">
<div class="namespaneltip"></div>
<div class="designernamelist">
<!--{foreach from=$D item=i}-->
<a href="#">{$i.user_name}</a>
<!--{/foreach}-->
</div>
<div class="namespanelpage1"></div>
</div>
<div class="imgspanel"></div>
<div class="imgspanel"></div>
</div>
<div id="show">
<div class="namespanel">
<div class="namespaneltip"></div>
<div class="designernamelist">
<!--{foreach from=$E item=i}-->
<a href="#">{$i.user_name}</a>
<!--{/foreach}-->
</div>
<div class="namespanelpage1"></div>
</div>
<div class="imgspanel"></div>
<div class="imgspanel"></div>
</div>
<div id="show">
<div class="namespanel">
<div class="namespaneltip"></div>
<div class="designernamelist">
<!--{foreach from=$F item=i}-->
<a href="#">{$i.user_name}</a>
<!--{/foreach}-->
</div>
<div class="namespanelpage1"></div>
</div>
<div class="imgspanel"></div>
<div class="imgspanel"></div>
</div>
<div id="show">
<div class="namespanel">
<div class="namespaneltip"></div>
<div class="designernamelist">
<!--{foreach from=$G item=i}-->
<a href="#">{$i.user_name}</a>
<!--{/foreach}-->
</div>
<div class="namespanelpage1"></div>
</div>
<div class="imgspanel"></div>
<div class="imgspanel"></div>
</div>
</div>
</div>
<div class="designerspanel" id="HN">
<a name="HN"></a>
<div class="wordtitle">Designer Name Order H to N</div>
<div class="tabspanel">
<ul>
<li class="blue"><span>Designer Name H</span></li>
<li class="black"><span>Designer Name I</span></li>
<li class="black"><span>Designer Name J</span></li>
<li class="black"><span>Designer Name K</span></li>
<li class="black"><span>Designer Name L</span></li>
<li class="black"><span>Designer Name M</span></li>
<li class="black"><span>Designer Name N</span></li>
</ul>
<div id="show">
<div class="namespanel">
<div class="namespaneltip"></div>
<div class="designernamelist">
<!--{foreach from=$H item=i}-->
<a href="#">{$i.user_name}</a>
<!--{/foreach}-->
</div>
<div class="namespanelpage2"></div>
</div>
<div class="imgspanel"></div>
<div class="imgspanel"></div>
</div>
<div id="show">
<div class="namespanel">
<div class="namespaneltip"></div>
<div class="designernamelist">
<!--{foreach from=$I item=i}-->
<a href="#">{$i.user_name}</a>
<!--{/foreach}-->
</div>
<div class="namespanelpage2"></div>
</div>
<div class="imgspanel"></div>
<div class="imgspanel"></div>
</div>
<div id="show">
<div class="namespanel">
<div class="namespaneltip"></div>
<div class="designernamelist">
<!--{foreach from=$J item=i}-->
<a href="#">{$i.user_name}</a>
<!--{/foreach}-->
</div>
<div class="namespanelpage2"></div>
</div>
<div class="imgspanel"></div>
<div class="imgspanel"></div>
</div>
<div id="show">
<div class="namespanel">
<div class="namespaneltip"></div>
<div class="designernamelist">
<!--{foreach from=$K item=i}-->
<a href="#">{$i.user_name}</a>
<!--{/foreach}-->
</div>
<div class="namespanelpage2"></div>
</div>
<div class="imgspanel"></div>
<div class="imgspanel"></div>
</div>
<div id="show">
<div class="namespanel">
<div class="namespaneltip"></div>
<div class="designernamelist">
<!--{foreach from=$L item=i}-->
<a href="#">{$i.user_name}</a>
<!--{/foreach}-->
</div>
<div class="namespanelpage2"></div>
</div>
<div class="imgspanel"></div>
<div class="imgspanel"></div>
</div>
<div id="show">
<div class="namespanel">
<div class="namespaneltip"></div>
<div class="designernamelist">
<!--{foreach from=$M item=i}-->
<a href="#">{$i.user_name}</a>
<!--{/foreach}-->
</div>
<div class="namespanelpage2"></div>
</div>
<div class="imgspanel"></div>
<div class="imgspanel"></div>
</div>
<div id="show">
<div class="namespanel">
<div class="namespaneltip"></div>
<div class="designernamelist">
<!--{foreach from=$N item=i}-->
<a href="#">{$i.user_name}</a>
<!--{/foreach}-->
</div>
<div class="namespanelpage2"></div>
</div>
<div class="imgspanel"></div>
<div class="imgspanel"></div>
</div>
</div>
</div>
<div class="designerspanel" id="OT">
<a name="OT"></a>
<div class="wordtitle">Designer Name Order O to T</div>
<div class="tabspanel">
<ul>
<li class="he"><span>Designer Name O</span></li>
<li class="black"><span>Designer Name P</span></li>
<li class="black"><span>Designer Name Q</span></li>
<li class="black"><span>Designer Name R</span></li>
<li class="black"><span>Designer Name S</span></li>
<li class="black"><span>Designer Name T</span></li>
</ul>
<div id="show">
<div class="namespanel">
<div class="namespaneltip"></div>
<div class="designernamelist">
<!--{foreach from=$O item=i}-->
<a href="#">{$i.user_name}</a>
<!--{/foreach}-->
</div>
<div class="namespanelpage3"></div>
</div>
<div class="imgspanel"></div>
<div class="imgspanel"></div>
</div>
<div id="show">
<div class="namespanel">
<div class="namespaneltip"></div>
<div class="designernamelist">
<!--{foreach from=$P item=i}-->
<a href="#">{$i.user_name}</a>
<!--{/foreach}-->
</div>
<div class="namespanelpage3"></div>
</div>
<div class="imgspanel"></div>
<div class="imgspanel"></div>
</div>
|
评分
-
查看全部评分
|