【发布时间】:2018-05-04 02:13:14
【问题描述】:
我尝试在 Google 和此处搜索“浏览器中的文件名更改为 0”,但没有找到。这是一个突然停止打开的简单文件。我什至无法让检查员解决它。撤消/重做历史丢失,所以这无济于事。我猜这是一个简单的错误,但我以前从未见过。
<!doctype html>
<html lang="en">
<head>
<title>JS Animated Navigation Test</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script>
<!--
var location = 0;
var bar = document.getElementById("bar1");
function myMove()
{
// if (id != 0) clearInterval(id);
location = -144;
// if (location != -144) return; // don't execute onmouseover while previous onmouseover is still running.
id = setInterval(move, 1);
}
function move()
{
location++;
bar.style.left = location + 'px';
if (location == 300)
{
clearInterval(id);
id = setInterval(moveback, 1);
}
}
function moveback()
{
location--;
bar.style.left = location + 'px';
if (location == -144)
{
clearInterval(id);
// id = setInterval(move, 1);
}
}
-->
</script>
<style>
#container
{
width: 600px;
height: 100px;
position: relative;
background: white;
}
#bar1
{
width: 150px;
height: 30px;
position: absolute;
left: -144px;
background-color: white;
}
</style>
</head>
<body>
<p>
<button onclick="myMove()">Click Me</button>
</p>
<div id ="container">
<div id ="animate"><img src="imageGalleryBar.png" alt="Image Gallery" width="150" height="30" id="bar1" onmouseover="myMove()" /></div>
</div>
</body>
</html>
谢谢
【问题讨论】:
-
标记。在 HTML 的语法中,script 标签之间有一些对应的特殊大小写。
-
好的,但他们仍然不应该使用它们,据说是为了支持旧版
-
我真的很想看到对 SO 进行的更改,该更改需要通过文档支持否决票,即问题是重复的或不允许的。这是/现在是一个合理的问题,并且(据怀疑)是一个简单的错误。
标签: javascript html css