jQuery點擊變色的效果

來源:互聯網
上載者:User

標籤:style   blog   http   color   java   io   cti   ar   

  • jQuery 點擊變色效果的代碼實現,點擊後文字所在方框的背景會變色,至於變成什麼顏色,隨你了,本代碼的重點是效果的實現,並不局限於細節。

 

<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head><title>接觸角測定儀</title></head><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></html>

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.