码迷,mamicode.com
首页 > 其他好文 > 详细

Day3-----easyCalendar

时间:2014-11-22 11:56:46      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:style   io   ar   使用   java   for   on   div   cti   

//----------------使用了innerHTML标签完成了对属性内容的引用和更改

<html>
<head><title>easyCalendar</title></head>
<style type="text/css">
.month{width: 70px;height: 70px;background: gray;float: left;margin: 5px;}
#year{width: 240px;height:450px;background: pink;text-align: center;margin: 10px auto;}
#text{width: 220px;height: 50px;background: white;float: left;margin: 10px;}
</style>
<script type="text/javascript">
window.onload=function(){
oMon=document.getElementsByClassName(‘month‘);
oTxt=document.getElementById(‘text‘);
for(var i=0;i<oMon.length;i++){
oMon[i].onmouseover=function(){
for(i=0;i<oMon.length;i++){oMon[i].style.background=‘gray‘}
this.style.background=‘white‘;
oTxt.innerHTML=(this.innerHTML)+‘ is coming.what do you want to to.‘;
}
}
}
</script>
<body>
<div id="year">
<h3>Calendar</h1>
<div class="month">January</div>
<div class="month">February</div>
<div class="month">March</div>
<div class="month">April</div>
<div class="month">May</div>
<div class="month">June</div>
<div class="month">July</div>
<div class="month">August</div>
<div class="month">September</div>
<div class="month">October</div>
<div class="month">November</div>
<div class="month">December</div>
<div id="text"></div>
</div>
</body>
</html>

Day3-----easyCalendar

标签:style   io   ar   使用   java   for   on   div   cti   

原文地址:http://www.cnblogs.com/fleshy/p/4114850.html

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