刚看的js,自己敲得时候就是不知道怎么回事 求解答啊。。
<title>无标题文档</title>
<script>
document.getElementById("link").onmouseclick = show;
document.getElementById("link").onmouseout = hide;
alert('欢迎光临本界面!!');
function show(){
alert(1);
}
function show(){
document.getElementById("ul1").style.onmouseover = 'block';
document.getElementById("link").style.background = 'yellow';
}
function hide(){
document.getElementById('ul1').style.display = 'none';
document.getElementById("link").style.background = 'yellow';
}
</script>
<style type="text/css">
.lis {
width:80px;
height:30px;
border:1px solid #000000;
position:relative;
width:100px;
list-style:none;
}
.lis a {
display:block;
line-height:30px;
text-align:center;
text-decoration:none;
}
ul ul {
margin:0px;
padding:0px;
border:1px solid #000000;
width:100px;
left:-1px;
top:30px;
background:#FFFF66;
visibility:hidden;
}
ul ul li {
text-align:center;
line-height:20px;
list-style:none;
width:40px;
}
</style>
</head>
<body>
<div>
<ul>
<li class="lis"> <a href="#" id="link">choose one</a></li>
<ul>
<li>dear</li>
<li>darling</li>
<li>sweetheart</li>
</ul>
</ul>
</div>
</body>
</html>
<script>
document.getElementById("link").onmouseclick = show;
document.getElementById("link").onmouseout = hide;
alert('欢迎光临本界面!!');
function show(){
alert(1);
}
function show(){
document.getElementById("ul1").style.onmouseover = 'block';
document.getElementById("link").style.background = 'yellow';
}
function hide(){
document.getElementById('ul1').style.display = 'none';
document.getElementById("link").style.background = 'yellow';
}
</script>
<style type="text/css">
.lis {
width:80px;
height:30px;
border:1px solid #000000;
position:relative;
width:100px;
list-style:none;
}
.lis a {
display:block;
line-height:30px;
text-align:center;
text-decoration:none;
}
ul ul {
margin:0px;
padding:0px;
border:1px solid #000000;
width:100px;
left:-1px;
top:30px;
background:#FFFF66;
visibility:hidden;
}
ul ul li {
text-align:center;
line-height:20px;
list-style:none;
width:40px;
}
</style>
</head>
<body>
<div>
<ul>
<li class="lis"> <a href="#" id="link">choose one</a></li>
<ul>
<li>dear</li>
<li>darling</li>
<li>sweetheart</li>
</ul>
</ul>
</div>
</body>
</html>
...全文
相关推荐
you-dont-know-js-ru:“您不知道JS”书籍系列的俄语翻译
随着Node.js的出现,JavaScript也逐渐在服务器端得到了广泛应用。在《您不知道的JS》中,作者Kyle Simpson深入讲解了JavaScript的类型系统。
深入探索JavaScript的你不知道的JS全集
函数是执行特定任务的代码块。在JavaScript中,函数可以使用function关键字定义,也可以采用函数表达式或箭头函数的形式。函数可以带参数,并且可以返回值。通过这些基础语法的讲解,我们可以开始构建简单而有效的JavaScript代码。下一章将探讨作用域和闭包,这是任何JavaScript开发者都需要深入理解的重要概念。闭包是JavaScript的一个强大特性,它允许函数访问并操作函数外部的变量。
read-You-Don-t-Know-JS:《你不知道JavaScript》 笔记
本文档为《你不知道的JavaScript》学习笔记,涵盖ES6语法支持配置、IDE项目结构管理及eval函数作用域特性的代码示例。重点分析了eval如何影响局部变量与闭包行为,体现JavaScript
《你不知道的JavaScript》.pdf
《你不知道的JavaScript》系列是一套专注于深入探讨JavaScript语言内部原理和机制的丛书。
Sudoku.js:javascript中的简单数独求解器
Sudoku.js" 是一个基于JavaScript实现的简单数独求解器。JavaScript是一种广泛应用于网页和网络应用开发的脚本语言,具有轻量级、解释型的特点,尤其适合用于客户端的交互式编程。


