码迷,mamicode.com
首页 > Web开发 > 详细

JS之DivColorChange

时间:2015-12-29 22:36:06      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:

index.html:

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JS之DivColorChange</title>
<script type="text/javascript" src="jquery-1.10.1.js"></script>
<script type="text/javascript" src="demo.js"></script>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<div style="width:200px;height:200px;background:red;">    
</div>
</body>
</html>

样式设置style.css:

.red {
    color:red;
}
.green {
    color:green;
}
.bg {
    background-color:#ccc;
}
.size {
    font-size:20px;
}

.js是jquery的脚本文件,作用是实现图片缓存和加载。(文件已经上传)

执行效果如图:

技术分享

JS之DivColorChange

标签:

原文地址:http://www.cnblogs.com/caidupingblogs/p/5087140.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!