效果图:

代码:

<!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>无标题文档</title>
<style type="text/css">
*{ margin:0; padding:0;}
#mark{ margin:200px auto;height:50px; width:300px;/* border:#CCC 1px solid;*/ position:relative;}
#mark ul{ height:100%; width:100%;}
ul li{ list-style:none; height:40px; width:40px; cursor:pointer; margin:0px; display:block; float:left;background:url(images/star.png) no-repeat 0 0;}
p{ padding:8px;height:25px; width:74px; border:#CCC 1px solid; display:none; position:absolute; left:210px; top:0px; line-height:25px; font-size:14px; font-family:"微软雅黑"; text-align:center;}
.active{ background-image:url(images/star.png); background-position:0 -40px;}
span{
display: none;
height: 0;
width: 0;
}
.left{
position: absolute;
border-color: transparent #CCC transparent transparent;
border-style:solid;
border-width:8px;
left:195px;
top:15px;
}
.right{
position: absolute;
border-color: transparent #FFF transparent transparent;
border-style:solid;
border-width:8px;
left: 196px;
top:15px;
}
</style>
<script type="text/javascript">
var optxt=['很差','较差','一般','推荐','力荐']
window.onload=function(){
var oDiv=document.getElementById('mark');
var aLi=oDiv.getElementsByTagName('li');
var oP=oDiv.getElementsByTagName('p')[0];
var ospan=oDiv.getElementsByTagName('span');
var i=0;

for(i=0; i<aLi.length;i++){
aLi[i].index=i;
/*鼠标移入事件*/
   aLi[i].onmouseover=function(){
oP.style.display ='block';
ospan[0].style.display ='block';
ospan[1].style.display ='block';
   oP.innerHTML=optxt[this.index];

for(i=0;i<=this.index;i++)
{aLi[i].className ='active';}
}

/*鼠标移出事件*/
    aLi[i].onmouseout=function(){
oP.style.display ='none';
ospan[0].style.display ='none';
ospan[1].style.display ='none';
   for(i=0;i<aLi.length;i++)
{ aLi[i].className ='';}/*鼠标离开的时候将所有li的class置空*/
}
/*鼠标点击事件*/
   aLi[i].onclick= function(){
alert('感谢您的评分!您给这部电影投了'+(this.index+1)+'分!');
}
}
}
</script>
</head>
<body>
<div id="mark">
 <ul>
  <li></li>
  <li></li>
  <li></li>
  <li></li>
  <li></li>
 </ul>
<p></p>
 <span class="left"></span><span class="right"></span>
</div>
</body>
</html>

今天就到这儿吧,赶紧复习去,马上就要考试了。。。。

最新文章

  1. java入门笔记(1)
  2. 使用bootstrap tooltip控件动态修改提示内容
  3. vue transition
  4. django 富文本展示 以及 post提交出错
  5. 计算机网络(7)-----TCP协议概述
  6. 6. Configure Compute services
  7. yii2购物车实现
  8. MicroPython开发板TPYBoard关于USB-HID的应用
  9. [Bhatia.Matrix Analysis.Solutions to Exercises and Problems]ExI.3.7
  10. 转载有个小孩跟我说LINQ(重点讲述Linq中GroupBy的原理及用法)
  11. Beyond Compare 相同文件对比结果仍显示红色 解决方案
  12. ACM比赛技巧
  13. 一些提高开发效率的 Category
  14. Android SDK 更新时修改hosts文件仍然无法更新,可试试这个方法……
  15. 在Linux上怎么安装和配置DenyHosts工具
  16. PB程序“无法启动此程序,因为计算机中丢失PBvm90.dll。尝试重新安装该程序以解决此问题”的解决方法
  17. Repair MySQL 5.6 GTID replication by injecting empty transactions
  18. 远程连接服务器jupyter notebook、浏览器以及深度学习可视化方法
  19. 11.2.0.4 aix下运行第二个节点root.sh报错处理
  20. spring深入学习(四)-----spring aop

热门文章

  1. windows hook (转)
  2. HDU2008-数值统计
  3. linux基础命令整理
  4. win7 64位 Xsheel
  5. SVN 在 linux 下的配置
  6. 分组求和SQL示例
  7. 转: Transact-sql游标使用详解~~很详细
  8. linux 的 ping 原理
  9. http://qt-project.org/wiki/Category:Developing_with_Qt::QtWebKit#ff7c0fcd6a31e735a61c001f75426961
  10. C标准函数库中获取时间与日期、对时间与日期数据操作及格式化