最模板 - 外贸网站建设,外贸网站模板

最模板

当前位置: 首页 > 建站教程 > CMS教程 > ECShop教程 >

jquery点击实现分类导航变色介绍

时间:2014-06-10 11:03来源: 作者: 点击:
style type="text/css" #t1,#t2,#t3,#t4{ height:30px; width:50px; background-color:#33FFFF; float:left; margin-left:50px; text-align:center; } .active{background-color:#FC5A0A!important;} /style scripttype="text/javascript"src="http://www.code
(责任编辑:admin)

<style type="text/css">

                   #t1,#t2,#t3,#t4{

                            height:30px;

                            width:50px;

                            background-color:#33FFFF;

                            float:left;

                            margin-left:50px;

                            text-align:center;

                   }

                   .active{background-color:#FC5A0A!important;}

         </style>

        

         <script type="text/javascript" src="http://www.codefans.net/ajaxjs/jquery1.3.2.js"></script>

         <script type="text/javascript">

                   jQuery(function(){

                            var list = jQuery('#t1, #t2, #t3, #t4');

                            list.click(function(){

                                     list.removeClass('active');

                                     jQuery(this).addClass('active');

                                     return false;

                            });

                   });

         </script>

         <body>

                   <div id="t1"><a href="#">1</a></div>

                   <div id="t2"><a href="#">2</a></div>

                   <div id="t3"><a href="#">3</a></div>

                  <div id="t4"><a href="#">4</a></div>

         </body>

 

------分隔线----------------------------
栏目列表
推荐内容