js特效子导航不随滚动条滚动而改变

<ul class="sub-nav" id="snav">
  {fycms table="Class_fy" top="7"  order="Orderid asc,ID asc" where="  rootid=[type:rootclassid]"}
 <li><a href="[classlink]" [fy:if [thisclassid] ] class="on"[/fy:if]>{ClassName}</a></li> 
	{/fycms}   
   </ul>


	<div class="ServiceBanner" id="kjsj">
		<div class="ServiceBannerIn">
			<div class="bd">
				<ul>
					{fycms table="Class_fy" top="10" order="id asc" where="classid=[type:classid]"}
					{classpicslideshow fun="classpicslide"}
					{/fycms}
				</ul>
			</div>
			<div class="hd">
				<ul>
					{fycms table="Class_fy" top="10" order="id asc" where="classid=[type:classid]"}
					{classpicslideshow fun="classpicslide"}
					{/fycms}
				</ul>
			</div>
		</div>
	</div>


<script type="text/javascript">
 var li = document.getElementById("kjsj").getElementsByTagName("li");
 for(var i=0;i<li.length;i++){
   li[i].className = "a"+(i+1)
}
if(document.body.clientWidth>=1020){ document.getElementById("snav").style.left = (document.body.clientWidth-980)/2-125+"px"}
</script>


/* 子导航 */
.sub-nav{width:110px;background:#DBDFDF;position:fixed;left:0px;z-index:999;_position:absolute;top:235px;_margin-top:-1px;
_top:expression(eval(document.documentElement.scrollTop+235))}
.sub-nav li{width:110px; height:60px; line-height:60px;font-size:12px;text-align:center;border-bottom:2px #fff solid;}
.sub-nav li a{width:110px;height:60px;line-height:60px; display:block; color:#555;}
.sub-nav li a:hover{ color:#fff;background-color:#40B290;}
.sub-nav li .on{background-color:#40B290; font-weight:bold;color:#fff;}
.sub-nav li .on a{color:#000;} 

参考网址:http://www.qh506.com/kjsjType/1.html

                  http://www.hetianhos.com/list.asp?cid=2560

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值