1
我無法制作使用javascript的網站。我想要做的是有一個排序的時間線,當每個節點通過鼠標傳遞時,任何一方的信息都會更新。但是,我無法使用鼠標懸停來處理節點。我相信這是因爲他們超過了基線,他們每個人的z-索引都是2.任何人都可以幫我解決這個問題嗎?onmouseover不適用於z-index高於1的項目
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="site.css">
<title></title>
<script type="text/javascript">
baseLine = new Image()
dash = new Image()
baby = new Image()
brokenleg = new Image()
compsci = new Image()
grad = new Image()
inhaler = new Image()
orioles = new Image()
python = new Image()
qohs = new Image()
bus = new Image()
baseLine.src="LineBase.png"
dash.src="images/dash.png"
baby.src="images/baby.png"
brokenleg.src="images/brokenleg.png"
compsci.src="images/compsci.png"
grad.src="images/grad.png"
inhaler.src="images/inhaler.png"
orioles.src="images/orioles.png"
python.src="images/python.png"
qohs.src="images/qohs.png"
bus.src="images/bus.png"
</script>
<script type="text/javascript">
function mouseOver()
{
alert(1); //testing purposes
}
</script>
</head>
<body>
<div id="container">
<div id="picture-container">
<img id="tagImage" src="images/baby.png" name="tag" onmouseover="alert(1)"/> // this works
</div>
<div id="time-line">
<img id="base" src="images/LineBase.png" />
<img class="dash" src="images/dash.png" onmouseover="alert(1)"/> // but this doesn't
<img class="dash" src="images/dash.png" />
<img class="dash" src="images/dash.png" />
<img class="dash" src="images/dash.png" />
<img class="dash" src="images/dash.png" />
<img class="dash" src="images/dash.png" />
<img class="dash" src="images/dash.png" />
<img class="dash" src="images/dash.png" />
<img class="dash" src="images/dash.png" />
<img class="dash" src="images/dash.png" />
</div>
<div id="story-box">
<h1 id="hey">hey</h1>
</div>
</div>
</body>
</html>
請您重新與http://jsfiddle.net的問題,並利用實際的URL的圖像,使它們是可見的。 – tw16
@tw http://jsfiddle.net/Habel/wfBX9/評論是我認爲正在發生的事情。 –