jQuery 抄袭笔记(4) : 通过JS更改CSS(2)
07 Oct 2011接着上一节的说,今天这个功能是实现背景和字体颜色的改变,所以说嘛,那些站上可以随意改变整站颜色的就不足为奇咯。
Html+JS+CSS:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=“http://www.w3.org/1999/xhtml”>
</span>
<meta http-equiv=“Content-Type” content=“text/html; charset=gb2312″ />
</span>修改样式</title>
<script type=“text/javascript” src=“jquery-1.1.3.pack.js”></script>
<script type=“text/javascript”>
$(document).ready(function(){
$(“#head”).click(function(){
$(“.content”).addClass(“lazy_color”);
});
});
</script>
<style type=“text/css”>
p,div{margin:;padding:;}
#head{border:1px solid ;width:100px; margin: auto;text-align:center;}
.content{width:35%;border:1px solid; margin:10px auto;padding:15px;}
.lazy_color{width:35%;border:1px solid #fff; margin:10px auto;background-color:#000;color:#c1c1c1;}
</style>
</head>
</span>
<p id=“head”>点我撒~~</p>
<div class=“content”>
<html xmlns=“http://www.w3.org/1999/xhtml”>
</span>
<meta http-equiv=“Content-Type” content=“text/html; charset=gb2312″ />
<script type=“text/javascript” src=“jquery-1.1.3.pack.js”></script>
<script type=“text/javascript”>
$(document).ready(function(){
$(“#head”).click(function(){
$(“.content”).addClass(“lazy_color”);
});
});
</script>
<style type=“text/css”>
p,div{margin:;padding:;}
#head{border:1px solid ;width:100px; margin: auto;text-align:center;}
.content{width:35%;border:1px solid; margin:10px auto;padding:15px;}
.lazy_color{width:35%;border:1px solid #fff; margin:10px auto;background-color:#000;color:#c1c1c1;}
</style>
</head>
</span>
<p id=“head”>点我撒~~</p>
<div class=“content”>
</span>
I cried a tear, you wiped it dry
I was confused, you cleared my mind
I sold my soul, you bought it back for me
And held me up and gave me dignity
Somehow you needed me
You gave me strength to stand alone again
To face the world out on my own again
You put me high upon a pedestal
So high that I could almost see eternity
You needed me, you needed me
And I can't believe it's you
I can't believe it's true
I needed you and you were there
And I'll never leave, why should I leave?
I'd be a fool 'cause I finally found someone who really cares
You held my hand when it was cold
When I was lost you took me home
You gave me hope when I was at the end
And turned my lies back into truth again
You even called me "friend"
You gave me strength to stand alone again
To face the world out on my own again
You put me high upon a pedestal
So high that I could almost see eternity
You needed me, you needed me
You needed me, you needed me
</pre>
</div>
</body>
</html> </div> 下载源码 解压密码 lazynight.me 转载请注明:[于哲的博客][1] » [jQuery 抄袭笔记(4) : 通过JS更改CSS(2)][2] [1]: http://lazynight.me [2]: http://lazynight.me/391.html