日期:2014-05-16  浏览次数:20356 次

JavaScript实现一个简单的网页换肤
<html>
<head>
<style type='text/css'>
  .skin{
    width:60px;
height:60px;
float:right;
margin:2px;
cursor:pointer;
  }
</style>
</head>


<body>
    <div class='skin' style='background-color:orange' onmouseover='changeColor("orange")'></div>
<div class='skin' style='background-color:pink' onmouseover='changeColor("pink")'></div>
<div class='skin' style='background-color:red' onmouseover='changeColor("red")'></div>
</body>
<script>
   function changeColor(c){
     document.body.style.backgroundColor = c ;
   }
</script>
</html>