一\
首先添加CSS样式
div,form,img,ul,ol,li,dl,dt,dd {margin:0;padding:0;border:0;}
dt,dd{clear:both;}
h1,h2,h3,h4,h5,h6 {margin:0;padding:0;}
/* 常用布局式样 */
.dis{display:block}
.undis{display:none}
.lefts{float:left;}
.rights{float:right;}
.tbcenter{margin:0 auto;}
.txtcenter{text-align:center;}
.clr{font-size:0;width:1px;clear:both;visibility:hidden;line-height:1px;}
/*R:首页排行2*/
#IndexTop{margin-bottom:16px;clear:both;}
#IndexTop p{float:left;line-height:21px;}
#IndexTop p.topTit{width:50px;font-weight:bold; color:#FFF; margin-top:6px;}
#IndexTop p.topC4{
width:30px;
cursor:pointer;
color:#FFF;
margin-top:3px;
text-align: center;
margin-left:3px;
}
#IndexTop p.topC5{
width:40px;
color:#FFFFFF;
margin-top:3px;
text-align: center;
background-color: #FF9966;
font-weight: bold;
}
#IndexTop #IndexTop_tit{height:24px; background:#0069B5;}
#IndexTop #IndexTop_cnt{
height:260px;
padding-top:7px;
line-height:26px;
text-align:left;
padding-left:37px;
background: url(../images/tech04.gif) no-repeat 12px 13px #FFF;
border-bottom:1px solid #B7B7B7;
}
#IndexTop #IndexTop_cnt a{color:#666;text-decoration:underline;}
#IndexTop #IndexTop_cnt a:hover{color:#C2130E;}
这是程序部份
<div id="IndexTop">
<div id="IndexTop_tit">
<p class="topTit"><img src="{S_URL}/templates/$_SCONFIG[template]/images/tech07.gif" align="absmiddle"> 排行</p>
<p class="topC4" style="cursor:pointer;">品牌</p>
<p class="topC4" style="cursor:pointer;">家具</p>
<p class="topC4" style="cursor:pointer;">服装</p>
<p class="topC4" style="cursor:pointer;">推荐</p>
</div>
<div id="IndexTop_cnt">
<span title="Don't delete me"></span>
<span>
<!--{block name="model" parameter="name/qy/grade/1,2,3,4,5/order/i.viewnum,i.dateline DESC/limit/0,10/cachetime/900/subjectlen/24/subjectdot/1/showcategory/1/cachename/qy1/tpl/data"}--><!--house-->
<!--{loop $_SBLOCK['qy1'] $value}-->
<ul><a href="$value[url]" title="$value[subjectall]" target="_blank">$value[subject]</a><ul>
<!--{/loop}-->
</span>
<span>
<!--{block name="model" parameter="name/qy/catid/13/order/i.viewnum,i.dateline DESC/limit/0,10/cachetime/900/subjectlen/24/subjectdot/1/showcategory/1/cachename/qy2/tpl/data"}--><!--house-->
<!--{loop $_SBLOCK['qy2'] $value}-->
<ul><a href="$value[url]" title="$value[subjectall]" target="_blank">$value[subject]</a><ul>
<!--{/loop}-->
</span>
<span>
<!--{block name="model" parameter="name/qy/catid/11/order/i.viewnum,i.dateline DESC/limit/0,10/cachetime/900/subjectlen/24/subjectdot/1/showcategory/1/cachename/qy3/tpl/data"}--><!--house-->
<!--{loop $_SBLOCK['qy3'] $value}-->
<ul><a href="$value[url]" title="$value[subjectall]" target="_blank">$value[subject]</a><ul>
<!--{/loop}-->
</span>
<span>
<!--{block name="model" parameter="name/qy/order/i.dateline DESC/limit/0,10/cachetime/900/subjectlen/24/subjectdot/1/showcategory/1/cachename/qy4/tpl/data"}--><!--house-->
<!--{loop $_SBLOCK['qy4'] $value}-->
<ul><a href="$value[url]" title="$value[subjectall]" target="_blank">$value[subject]</a><ul>
<!--{/loop}-->
</span>
</div>
<script>
var Tags2=document.getElementById('IndexTop_tit').getElementsByTagName('p');
var TagsCnt2=document.getElementById('IndexTop_cnt').getElementsByTagName('span');
var len2=Tags2.length;
var flag2=1;//修改默认值
for(j=1;j<len2;j++){
Tags2[j].value = j;
Tags2[j].onmouseover=function(){changeNav2(this.value)};
TagsCnt2[j].className='undis';
}
Tags2[flag2].className='topC5';
TagsCnt2[flag2].className='dis';
function changeNav2(t){
Tags2[flag2].className='topC4';
TagsCnt2[flag2].className='undis';
flag2=t;
Tags2[t].className='topC5';
TagsCnt2[t].className='dis';
}
</script>
</div> |