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>

Link to comment
Share on other sites

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

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

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