Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery drop down menu not working properly
    primarykey
    data
    text
    <p>I am quite new to website designing and i have been trying to solve this solution since last few hours but couldnt find any solution. I am trying to make a drop down menu. here is the html codes..</p> <pre><code>&lt;ul class="mainnav"&gt; &lt;li&gt;&lt;a href="#" class="navText"&gt; &lt;span class="navText"&gt; Home &lt;/span&gt; &lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" class="navText"&gt;&lt;span class="navText"&gt; Games &lt;/span&gt;&lt;/a&gt; &lt;ul&gt; &lt;li&gt; Battlefield 3&lt;/li&gt; &lt;li&gt; Call Of Duty &lt;/li&gt; &lt;li&gt; Assiaisn's creed &lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="#" class="navText"&gt; &lt;span class="navText"&gt; Servers &lt;/span&gt; &lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" class="navText"&gt; &lt;span class="navText"&gt; Coming Soon &lt;/span&gt; &lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>and css is like...</p> <pre><code>ul.mainnav{ background:#f9f9f9; font-size:25px; margin:0; padding:0; height:50px; display:inline-block; min-width:200px; list-style:none; border-bottom:1px solid #ccc; } ul.mainnav &gt; li{ background:#f9f9f9; height:50px; float:left; margin:0; padding:0; } ul.mainnav &gt; li a{ font-family: 'Poiret One', cursive; font-size:20px; color:#333333; text-decoration:none; display:inline-block; height:50px; line-height:50px; padding:0; position:relative; top:0px; margin:0; overflow:hidden } ul.mainnav &gt; li a span.navText{ height:50px; padding:0px 15px 0px 15px; display:block; /*outline:1px dashed blue; */ } ul.mainnav &gt; li a span.hiddenText{ display:block; line-height:50px; height:50px; color: red; padding:0; margin:0px; /* outline:1px dashed green; */ } ul.mainnav &gt; li ul{ width:200px; background:#CCCCCC; font-family: 'Poiret One', cursive; font-size:18px; position:absolute; margin:0px; padding:0px; } ul.mainnav &gt; li ul li{ height:50px; line-height:50px; display:block; clear:left; float:left; width: 200px; margin:0; } </code></pre> <p>and js is like..</p> <pre><code>$(document).ready(function() { $( "span.navText" ).each(function(color) { var text = $(this).text() $(this).append('&lt;br&gt;&lt;span class="hiddenText"&gt;'+text+'&lt;/span&gt;') }); $('ul.mainnav li a').hover( function(){ $(this).stop().children('span.navText').stop().animate({ marginTop: '-50', }, 250) }, function(){ $(this).stop().children('span.navText').stop().animate({ marginTop: '0', }, 250) } ) }); </code></pre> <p>Now the problem is sub-menu is not positioned correctly. You can see this here... <a href="http://jsfiddle.net/yMUUN/" rel="nofollow">http://jsfiddle.net/yMUUN/</a> </p> <p>I want to remove that small gap between main menu and sub menu.</p> <p>It would be very helpful for me if you can help me in solving this problem. Thanks in advance!</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