练习 bottom和函数
来源:互联网 发布:ubuntu terminal 配置 编辑:程序博客网 时间:2024/05/16 18:05
<!--
编程挑战
小伙伴们,请编写"改变颜色"、"改变宽高"、"隐藏内容"、"显示内容"、"取消设置"的函数,点击相应按钮执行相应操作,点击"取消设置"按钮后,提示是否取消设置,如是执行操作,否则不做操作。
<!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; font-size: 14px; }
a { color: #333; text-decoration: none }
ul { list-style: none; height: 30px; border-bottom: 5px solid #F60; margin-top: 20px; padding-left: 0px; }
ul li { float: left }
ul li a { display: block; height: 30px; text-align: center; line-height: 30px; width:100px; background: #efefef; margin-left: 1px; }
a.on, a:hover { background: #F60; color: #fff; }
</style>
<script>
window.onload=function(){
var aA=document.getElementsByTagName('a');
for(var i=0; i<aA.length; i++){
aA[i].onmouseover=function(){
var This=this;
【任务1】(This.time);
This.time=【任务2】(function(){
This.style.width=This.offsetWidth+8+"px";
if(This.【任务3】>=160)
clearInterval(This.time);
},30)
}
aA[i].onmouseout=function(){
clearInterval(this.time);
var This=this;
this.time=setInterval(function(){
This.style.width=This.offsetWidth-8+"px";
if(This.offsetWidth<=120){
This.style.width='120px';
clearInterval(This.time);
}
},30)
}
}
}
</script>
</head>
<body>
<ul>
<li><a class="on" href="#">首 页</a></li>
<li><a href="#">新闻快讯</a></li>
<li><a href="#">产品展示</a></li>
<li><a href="#">售后服务</a></li>
<li><a href="#">联系我们</a></li>
</ul>
</body>
</html>
0 0
- 练习 bottom和函数
- padding-bottom和 margin-bottom
- bottom
- c函数和指针练习
- blank.php 和 bottom.php
- [ ]运算符重载和函数模板练习
- shu7-19【背包和母函数练习】
- Python练习代码 -- 模块和函数
- 【入门】最大公约数和最小公倍数 【函数练习】
- php-mysql 函数练习和使用!
- 练习35——分支和函数
- Go指南练习之《循环和函数》
- go指南练习:循环和函数
- "bottom line" 和 "底线”可以互译吗?
- 重新认识margin-top和margin-bottom
- Android Bottom Sheet属性和使用详解
- 函数练习
- 函数练习
- c/c++大纲
- MySQL dump步骤
- 2015 3.10-3.23
- hiho一下 第十五周——最近公共祖先·二(Trajan,离线LCA)
- unix信号处理机制
- 练习 bottom和函数
- C# 清除IE缓存方法
- Java多线程学习(吐血超详细总结)
- magento admin chrome firefox
- LeetCode:Subsets
- Linux删除日志文件和清除日志文件脚本
- 产品经理们都是怎样成为产品经理的?
- 新手App上架问题
- GUN ARM汇编中标号的引用在汇编和C语言中区别(monitor_flash_len = _bss_start - _armboot_start;)