Jump to content

Why doesn't my javascript work in Internet explorer.


heldenbrau

Recommended Posts

I have made a popup menu with javascript and CSS for my website

 

http://www.diamondcz.co.uk/index.shtml

 

When I was working on it I was viewing it in Firefox.  But it doesn't work at all in internet explorer.  I have set a div id in CSS to not display and using javascript, changed the CSS to display when the mouse goes over the menu item.  eg.

 

<div class="menutitles"
onmouseover="document.getElementById('ha').style.display='block';document.getElementById('ha2').style.display='block';"
onmouseout="document.getElementById('ha').style.display='none';document.getElementById('ha2').style.display='block';"
>
<a class="topseltxt" href="heartsarrows.shtml">Hearts & Arrows</a><br/>

<div class="contain" id="ha">
<div class="menuitems" id="ha2">

<a class="topseltxt2" href="8heartsarrows.shtml">8 Hearts & Arrows</a><br/>
<a class="topseltxt2" href="heartsarrows.shtml">10 Hearts & Arrows</a><br/>
</div> </div> </div>

Try passing the value into javascript function

so instead of doing right away like what you did

 

<div class="menutitles"

onmouseover="document.getElementById('ha').style.display='block';document.getElementById('ha2').style.display='block';"

>

 

try:

<head>

<script type="text/javascript">

function setblock(){

document.getElementById('ha').style.display='block';document.getElementById('ha2').style.display='block';}

</script>

</head>

<body>

<div class="menutitles" onmouseover="setblock()">

</body>

 

hope it helps

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.