当前位置:编程学习 > thinkphp >>

thinkphp和jquery隔行换色

js部分
 <script  language="javascript" type="text/javascript" src="__PUBLIC__/js/jquery.js">

</script>
<Script language="JavaScript" type="text/javascript">
$(document).ready(function () {

$("#left_bottom   li:even ").addClass("bg");
$("#left_bottom   li:odd ").addClass("bg1");

});
</Script>


html代码
 <div id="left_bottom">
           <ul> 
            <volist name="mokuai" id="vo">
           <li class="bg"><a href="__URL__/chuangyi?lawid={$vo.products_id}" ><strong>{$vo.products_name}</strong></a></li>
          </volist>
</div>


css
.bg{background:url(../images/cy_07.gif) no-repeat left top;}
.bg1{background:url(../images/cy_09.gif) no-repeat left top;}
 作者:nycqwert

补充:Web开发 , php ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,