<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>
|