......
<!doctype html>
<html>
<head>
??? <meta charset="utf-8"></meta>
??? <script src="http://idcbgp.cn/data/jquery-1.8.2.min.js" type="text/javascript"></script>
??? <script>
??????? /*-------------------------------------/
??????? 函數(shù)功能:當(dāng)移到列表項(xiàng)時(shí),背景顏色會(huì)發(fā)生
??????? 改變,移開(kāi)時(shí)又恢復(fù)原來(lái)的背景色
??????? ---------------------------------------*/
??????? ;(function($){
??????????? $.extend({
??????????????? "focusColor":function(bgColor){
??????????????????? $("ul li").mouseover(function(){
??????????????????????? $(this).css("backgroundColor",bgColor);
??????????????????? }).mouseout(function(){
??????????????????????? $(this).css("backgroundColor",'#fff');
??????????????????? });
??????????????? }
??????????? })???
??????? })(jQuery)
???????
??????? $(function(){
??????????? $.focusColor("#eee");
??????? })
??? </script>
</head>
<body>
??? <ul>
??????? <li>第一項(xiàng)</li>
??????? <li>第二項(xiàng)</li>
??????? <li>第三項(xiàng)</li>
??? </ul>
</body>
</html>
2016-03-24
function前面多了一個(gè)分號(hào),不錯(cuò)的方法