Note that there are some explanatory texts on larger screens.

plurals
  1. POi keep getting Uncaught ReferenceError: dropMenu is not defined and Uncaught TypeError: Cannot read property 'style' of null
    text
    copied!<p>im trying to make nav bar with sub menus but i keeping getting dropMenu is not defined and when i hover over the two paris links i get Uncaught TypeError: Cannot read property 'style' of null any idea what is causing this here is my code html</p> <pre><code>&lt;html&gt; &lt;link type="text/css" rel="stylesheet" href="vacation.css"/&gt; &lt;head&gt; &lt;title&gt;Paris&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="menus"&gt; &lt;div id ="parismenu"&gt; &lt;a href="#" onmouseover="dropMenu('dropmenu1')"&gt;Paris&lt;/a&gt; &lt;div id="dropmenu1" class="dropmenus"&gt; &lt;a href="#"&gt;apple&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id ="disneymenu"&gt; &lt;a href="#" onmouseover="dropMenu('dropmenu2')"&gt;Paris&lt;/a&gt; &lt;div id="dropmenu2" class="dropmenus"&gt; &lt;a href="#"&gt;apple&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="vacation.js"&gt;&lt;/script&gt; &lt;/html&gt; </code></pre> <p>css</p> <pre><code>div#menus{ margin-left:16px; } div#menus&gt; div{ float:left; margin:0px 20px; } div.dropmenus{ display:none; position:absolute; top:100px; width:120px; background:teal; z-index:2; padding:4px; border: blue 3px solid; border-top:none; border-radius:5px 5px 5px 5px; } div.dropmenus&gt;a{ display:block; margin:4px; padding:7px; font-size:14px; text-decoration:none; background:blue; border-radius:3px; color:red; } div#dropmenu1{ left:24px; } div#dropmenu2{ left:116px; } </code></pre> <p>javascript</p> <pre><code> var fade=function(){ return{ init:function(id,flag,target){ this.elem=document.ElementById(id); clearInterval(this.elem.si); this.target=target ? target : flag ? 100 : 0; this.flag = flag||1; this.alpha = this.elem.stle.opacity ? parseFloat(this.elem.style.opacity) * 100 : 0; this.elem.si=setIntterval(function(){fade.fadep()},20); }, fadep:function(){ if(this.alpha==this.target){ clearInterval(this.elem.si); } else{ var value=Math.round(this.alpha + ((this.target - this.alpha) * .05)) +(-1 * this.flag); this.elem.style.opacity=value/100; this.elem.style.filter='alpha(opacity=' + value + ')'; this.alpha=value }}}}(); var menu= ["dropmenu1","dropmenu2","dropmenu3"]; function dropMenu(x){ for(var m in menu){ if(menu[m] != x){ document.getElementById(menu[m]).style.display="none"; }} if(document.getElementById(x).style.diplay=="block"){ fade.init(x,1); } else{ fade.init(x,0)}} </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload