|
|
|
|
|
для: Reinger
(10.06.2007 в 17:43)
| | Переставьте буквочки местами - не scrElement, а srcElement | |
|
|
|
|
|
|
| Добрый день! Нашел скрипт, который корректно работает в Мозилле, а в ИЕ нет.
Подскажите пожалуйста в чем проблема
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head><title>Menu</title>
<style type="text/css">
#container div {
display:none;
}
</style>
<script type="text/javascript">
window.onload = function()
{
for (i = 1; i <= 3; i++) {
document.getElementById("a"+i).onmouseover = function(oEvent)
{
show(oEvent);
}
document.getElementById("a"+i).onmouseout = function(oEvent)
{
hide();
}
}
}
function hide()
{
for (i = 1; i <= 3; i++) {
document.getElementById("help"+i).style.display = "none";
}
}
function show(oEvent)
{
oEvent = oEvent || window.event;
var a = oEvent.target || oEvent.scrElement;
hide();
document.getElementById( "help" + a.id.substr(1) ).style.display = "block";
}
</script>
</head>
<body>
<a href="#" id="a1">Пункт 1</a> |
<a href="#" id="a2">Пункт 2</a> |
<a href="#" id="a3">Пункт 3</a>
<div id="container">
<div id="help1">Подсказка 1</div>
<div id="help2">Подсказка 2</div>
<div id="help3">Подсказка 3</div>
</div>
</body>
</html>
|
| |
|
|
|
|