Jump to content
  • 0

Выпадающее меню при нажатии на ссылку


Alek7y7
 Share

Question

В Fire-Fox-е не работает, все остальные браузеры порядок...

Текст Java Script:

<script language="JavaScript">

function clickHandler()

{ var targetId, srcElement,

targetElement; srcElement = window.event.srcElement;

if (srcElement.className == "Outline") {

targetId = srcElement.id + "details";

targetElement = document.all(targetId);

if (targetElement.style.display == "none") {

targetElement.style.display = "";

} else {

targetElement.style.display = "none";

} }} document.onclick = clickHandler;

</script>

Текст HTML:

<ul style="list-style-type:disc">

<li>

<a href id="Out0" class="Outline" style="cursor: hand">

ПЕЧАТЬ НА БУМАГЕ</a></li>

<div id=Out0details style="display:None; position:relative; left:9;">

Текст, текст, текст

</div><BR>

<li>

<a href id="Out1" class="Outline" style="cursor: hand">

ПЕЧАТЬ НА БАННЕРЕ И СЕТКЕ</a></li>

<div id=Out1details style="display:None; position:relative; left:9;">

Текст, текст, текст

</div><BR>

Текст CSS:

a.Outline {

text-align:left;

font-size:9.5pt;

color: white;

font-family:Arial, Helvetica, Geneva, sans-serif;

line-height:3.0;

text-decoration: underline;

}

.Outline:hover {

color: RGB(56, 198, 244);

}

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0
function clickHandler(event)
{
var targetId, srcElement, targetElement;
event = event || window.event;
srcElement = event.target || event.srcElement;
if (srcElement.className == "Outline")
{
targetId = srcElement.id + "details";

targetElement = document.getElementById(targetId);
if (targetElement.style.display == "none")
{
targetElement.style.display = "block";
}
else
{
targetElement.style.display = "none";
}
}
}
document.onclick = clickHandler;

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy