Note that there are some explanatory texts on larger screens.

plurals
  1. POcreating navigation bar with jquery
    primarykey
    data
    text
    <p>I am trying to create a navigation bar following is my code: html: This is Navigation baar</p> <pre><code>&lt;div class="cat-set"&gt; &lt;div class="icon-wrap"&gt; &lt;div class="icons active" id="mobiles"&gt;&lt;div class="bgimg mobiles"&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class="icons" id="laptops"&gt;&lt;div class="bgimg laptops"&gt;&lt;/div&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>on hover of each <code>'.icons'</code> class a division will be shown, so there are two boxes to show and hide, this is the code for this:</p> <pre><code>&lt;div class="cat-demo" id="mobiles"&gt; &lt;p&gt;This is for mobiles, if mouse is on .mobiles then this will be shown&lt;/p&gt; &lt;/div&gt; &lt;div class="cat-demo" id="tablets"&gt; &lt;p&gt;This is for tablets, if mouse is on .mobiles then this will be shown&lt;/p&gt; &lt;/div&gt; </code></pre> <p>this is Jquery code for this:</p> <pre><code>$('.icons').hover(function(){ $('.icons').each(function(){$(this).removeClass("active");}); $(this).addClass("active"); var position = $(this).position(); $('.cat-demo').css({'left':(position.left-4)+'px'}); var showThis=$(this).attr("id") $(".cat-demo:visible").hide() $("'#"+showThis+".cat-demo'").show(); }); </code></pre> <p>So till here everything is working fine, but problem is I want to hide the <code>'.cat-demo'</code> if mouse pointer is out of out of <code>'.icons'</code> and if pointer is on <code>.cat-demo</code> then it should not hide this. please help me... If you want to change the html layout please go ahead.</p> <p>this is the fiddle link for this <a href="http://jsfiddle.net/ndevJ/" rel="nofollow">http://jsfiddle.net/ndevJ/</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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