<div class="codetitle"> <span><a style="CURSOR: pointer" data="61675" class="copybut" id="copybut61675" onclick="doCopy('code61675')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code61675"> <br> <br> <br> <br><title></title> <br><script type="text/javascript" src="Scripts/jquery-1.10.2.min.js"></script> <br><script src="Scripts/jquery.cookie.js" type="text/javascript"></script> <br><style type="text/css"> <BR>#p1{ background-color:Red ; width:40px; border:solid 1px yellow ; margin:5px; float:left} <BR>#p2{background-color:Yellow ;width:40px; border:solid 1px red; margin:5px; float:left} <BR>#p3{background-color:Blue;width:40px; border:solid 1px yellow; margin:5px; float:left} <BR></style> <br><script type="text/javascript"> <BR>$(function () { <BR>if ($.cookie("bgcolor")) { <BR>$("body").css("background-color", $.cookie("bgcolor")); <BR>} <br><br>$("p").click(function () { <BR>$("body").css("background-color", $(this).css("background-color")); <BR>$.cookie("bgcolor", $("body").css("background-color"), { expires: 7 }); <BR>}) <BR>}) <BR></script> <br> <br> <br><p id="p1">红色</p> <p id="p2">黄色</p> <p id="p3">蓝色</p> <br> <br> <br> </div>