<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Workaround for dropdown menu hover on mobile browsers	</title>
	<atom:link href="https://stampede-design.com/blog/dropdown-menu-hover/feed/" rel="self" type="application/rss+xml" />
	<link>https://stampede-design.com/blog/dropdown-menu-hover/</link>
	<description>We are creating better worlds though thoughtful design and technology. Connect with us!</description>
	<lastBuildDate>Tue, 07 Apr 2026 09:06:13 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.5</generator>
	<item>
		<title>
		By: Emile		</title>
		<link>https://stampede-design.com/blog/dropdown-menu-hover/#comment-102482</link>

		<dc:creator><![CDATA[Emile]]></dc:creator>
		<pubDate>Wed, 14 Sep 2016 02:48:39 +0000</pubDate>
		<guid isPermaLink="false">https://stampede-design.com/blog/?p=3039#comment-102482</guid>

					<description><![CDATA[An impressive share! I have just forwarded this onto a 
coworker who was doing a little research on this. And he in fact 
bought me dinner simply because I discovered it for him...
lol. So allow me to reword this.... Thanks 
for the meal!! But yeah, thanks for spending some time to talk about this topic 
here on your internet site.]]></description>
			<content:encoded><![CDATA[<p>An impressive share! I have just forwarded this onto a<br />
coworker who was doing a little research on this. And he in fact<br />
bought me dinner simply because I discovered it for him&#8230;<br />
lol. So allow me to reword this&#8230;. Thanks<br />
for the meal!! But yeah, thanks for spending some time to talk about this topic<br />
here on your internet site.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Simple Dropdown Hover Menu Fix for Mobile Devices - BJD		</title>
		<link>https://stampede-design.com/blog/dropdown-menu-hover/#comment-37969</link>

		<dc:creator><![CDATA[Simple Dropdown Hover Menu Fix for Mobile Devices - BJD]]></dc:creator>
		<pubDate>Thu, 23 Oct 2014 17:20:27 +0000</pubDate>
		<guid isPermaLink="false">https://stampede-design.com/blog/?p=3039#comment-37969</guid>

					<description><![CDATA[[&#8230;] This code is 100% the work of Stampede-Design in Malaysia. The original post can be found here. [&#8230;]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] This code is 100% the work of Stampede-Design in Malaysia. The original post can be found here. [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Geoffrey Burdett		</title>
		<link>https://stampede-design.com/blog/dropdown-menu-hover/#comment-29636</link>

		<dc:creator><![CDATA[Geoffrey Burdett]]></dc:creator>
		<pubDate>Fri, 12 Sep 2014 18:47:27 +0000</pubDate>
		<guid isPermaLink="false">https://stampede-design.com/blog/?p=3039#comment-29636</guid>

					<description><![CDATA[Thanks!  This is the simplest solution I&#039;ve found...and this is much simpler way to close it:

[js]
$(document).ready(function(){
    if (is_touch_device){
        $(&#039;#mainmenu &#038;gt; li &#038;gt; a&#039;).click(function(event) {
            event.preventDefault();
        });

//////////////////////////////////////////
// A click any where else hides the menu //
/////////////////////////////////////////
        $(&#039;:not(#mainmenu &#038;gt; li &#038;gt; a)&#039;).click(function(event) {
            $(&#039;#mainmenu &#038;gt; li &#038;gt; a&#039;).css(&#039;display&#039;,&#039;none&#039;);
        });

    }
});
[/js]]]></description>
			<content:encoded><![CDATA[<p>Thanks!  This is the simplest solution I&#8217;ve found&#8230;and this is much simpler way to close it:</p>
<pre class="brush: jscript; title: ; notranslate">
$(document).ready(function(){
    if (is_touch_device){
        $('#mainmenu &amp;gt; li &amp;gt; a').click(function(event) {
            event.preventDefault();
        });

//////////////////////////////////////////
// A click any where else hides the menu //
/////////////////////////////////////////
        $(':not(#mainmenu &amp;gt; li &amp;gt; a)').click(function(event) {
            $('#mainmenu &amp;gt; li &amp;gt; a').css('display','none');
        });

    }
});
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jeremy		</title>
		<link>https://stampede-design.com/blog/dropdown-menu-hover/#comment-29551</link>

		<dc:creator><![CDATA[Jeremy]]></dc:creator>
		<pubDate>Thu, 11 Sep 2014 03:56:28 +0000</pubDate>
		<guid isPermaLink="false">https://stampede-design.com/blog/?p=3039#comment-29551</guid>

					<description><![CDATA[Nice article! It got me on the right track, but wasn&#039;t exactly what I needed. Here&#039;s what I got working. Hopefully it&#039;s pretty self-explanatory. If not, here&#039;s my stack overflow post about it:
http://stackoverflow.com/a/25778756/1076872

[js]
function isTouchDevice(){
 return typeof window.ontouchstart !== &#039;undefined&#039;;
}

jQuery(document).ready(function(){
 /* If mobile browser, prevent click on parent nav item from redirecting to URL */
 if(isTouchDevice()) {
   // 1st click, add &#034;clicked&#034; class, preventing the location change. 2nd click will go through.
   jQuery(&#034;#menu-main-menu &#038;gt; li &#038;gt; a&#034;).click(function(event) {
      // Perform a reset - Remove the &#034;clicked&#034; class on all other menu items
     jQuery(&#034;#menu-main-menu &#038;gt; li &#038;gt; a&#034;).not(this).removeClass(&#034;clicked&#034;);
      jQuery(this).toggleClass(&#034;clicked&#034;);
      if (jQuery(this).hasClass(&#034;clicked&#034;)) {
       event.preventDefault();
     }
   });
 }
});
[/js]]]></description>
			<content:encoded><![CDATA[<p>Nice article! It got me on the right track, but wasn&#8217;t exactly what I needed. Here&#8217;s what I got working. Hopefully it&#8217;s pretty self-explanatory. If not, here&#8217;s my stack overflow post about it:<br />
<a href="http://stackoverflow.com/a/25778756/1076872" rel="nofollow ugc">http://stackoverflow.com/a/25778756/1076872</a></p>
<pre class="brush: jscript; title: ; notranslate">
function isTouchDevice(){
 return typeof window.ontouchstart !== 'undefined';
}

jQuery(document).ready(function(){
 /* If mobile browser, prevent click on parent nav item from redirecting to URL */
 if(isTouchDevice()) {
   // 1st click, add &quot;clicked&quot; class, preventing the location change. 2nd click will go through.
   jQuery(&quot;#menu-main-menu &amp;gt; li &amp;gt; a&quot;).click(function(event) {
      // Perform a reset - Remove the &quot;clicked&quot; class on all other menu items
     jQuery(&quot;#menu-main-menu &amp;gt; li &amp;gt; a&quot;).not(this).removeClass(&quot;clicked&quot;);
      jQuery(this).toggleClass(&quot;clicked&quot;);
      if (jQuery(this).hasClass(&quot;clicked&quot;)) {
       event.preventDefault();
     }
   });
 }
});
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Shaza Hakim		</title>
		<link>https://stampede-design.com/blog/dropdown-menu-hover/#comment-260</link>

		<dc:creator><![CDATA[Shaza Hakim]]></dc:creator>
		<pubDate>Sun, 20 Jul 2014 22:45:30 +0000</pubDate>
		<guid isPermaLink="false">https://stampede-design.com/blog/?p=3039#comment-260</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://stampede-design.com/blog/dropdown-menu-hover/#comment-259&quot;&gt;google&lt;/a&gt;.

Looks all okay here. May I know your IE version?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://stampede-design.com/blog/dropdown-menu-hover/#comment-259">google</a>.</p>
<p>Looks all okay here. May I know your IE version?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: google		</title>
		<link>https://stampede-design.com/blog/dropdown-menu-hover/#comment-259</link>

		<dc:creator><![CDATA[google]]></dc:creator>
		<pubDate>Sat, 19 Jul 2014 01:48:04 +0000</pubDate>
		<guid isPermaLink="false">https://stampede-design.com/blog/?p=3039#comment-259</guid>

					<description><![CDATA[Hey, I think your website might be having browser compatibility issues.
When I look at your website in Firefox, it looks fine but when opening in Internet 
Explorer, it has some overlapping. I just wanted to give you a quick heads up!
Other then that, fantastic blog!]]></description>
			<content:encoded><![CDATA[<p>Hey, I think your website might be having browser compatibility issues.<br />
When I look at your website in Firefox, it looks fine but when opening in Internet<br />
Explorer, it has some overlapping. I just wanted to give you a quick heads up!<br />
Other then that, fantastic blog!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Shaiful Borhan		</title>
		<link>https://stampede-design.com/blog/dropdown-menu-hover/#comment-258</link>

		<dc:creator><![CDATA[Shaiful Borhan]]></dc:creator>
		<pubDate>Mon, 05 May 2014 15:36:49 +0000</pubDate>
		<guid isPermaLink="false">https://stampede-design.com/blog/?p=3039#comment-258</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://stampede-design.com/blog/dropdown-menu-hover/#comment-257&quot;&gt;Joshua&lt;/a&gt;.

@Joshua Thank you for the creative solution :)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://stampede-design.com/blog/dropdown-menu-hover/#comment-257">Joshua</a>.</p>
<p>@Joshua Thank you for the creative solution 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Joshua		</title>
		<link>https://stampede-design.com/blog/dropdown-menu-hover/#comment-257</link>

		<dc:creator><![CDATA[Joshua]]></dc:creator>
		<pubDate>Fri, 02 May 2014 22:14:03 +0000</pubDate>
		<guid isPermaLink="false">https://stampede-design.com/blog/?p=3039#comment-257</guid>

					<description><![CDATA[Here&#039;s a &lt;a href=&quot;http://pastebin.com/P2A6bEu1&quot; rel=&quot;nofollow&quot;&gt;pastebin&lt;/a&gt;

http://pastebin.com/P2A6bEu1]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a <a href="http://pastebin.com/P2A6bEu1" rel="nofollow">pastebin</a></p>
<p><a href="http://pastebin.com/P2A6bEu1" rel="nofollow ugc">http://pastebin.com/P2A6bEu1</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Joshua		</title>
		<link>https://stampede-design.com/blog/dropdown-menu-hover/#comment-256</link>

		<dc:creator><![CDATA[Joshua]]></dc:creator>
		<pubDate>Fri, 02 May 2014 18:58:55 +0000</pubDate>
		<guid isPermaLink="false">https://stampede-design.com/blog/?p=3039#comment-256</guid>

					<description><![CDATA[Here&#039;s how I solved making a link to the top level page work:

Clone the top level menu item into the sub-menu and add a class for that item. Then use a conditional to disable the links for menu items not with that class. That&#039;s a lot of double negatives but here is the code (if it lets me include it):
[js]
function is_touch_device() {
  return !!(&#039;ontouchstart&#039; in window);
}

jQuery(document).ready(function($) { 
  
  /* If mobile browser, prevent click on parent nav item from redirecting to URL */
  if(is_touch_device()) { 

    $(&#039;#main-menu li#your-menu-item-id&#039;).clone().prependTo(&#039;li#your-menu-item-id &#038;amp;gt; ul.sub-menu&#039;).addClass(&#039;mobile-tl&#039;);

    $(&#039;#main-menu li:not(.mobile-tl) &#038;amp;gt; ul&#039;).each(function (index, elem) {

      /* Option 1: Use this to modify the href on the &#038;lt;a&#038;gt; to # */
      $(elem).prev(&#039;a:first&#039;).attr(&#039;href&#039; ,&#039;#&#039;);

      /* OR Option 2: Use this to keep the href on the &#038;lt;a&#038;gt; intact but prevent the default action */
      $(elem).prev(&#039;a:first&#039;).click(function(event) {
          event.preventDefault();
      });
    });
  }
  
});
[/js]
The key here is using jQuery clone, adding the class and then using the conditional for that class to disable the links. The other key is using the pseudo selector :first as well. I&#039;m sure this could be cleaned up a bit but it works.]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s how I solved making a link to the top level page work:</p>
<p>Clone the top level menu item into the sub-menu and add a class for that item. Then use a conditional to disable the links for menu items not with that class. That&#8217;s a lot of double negatives but here is the code (if it lets me include it):</p>
<pre class="brush: jscript; title: ; notranslate">
function is_touch_device() {
  return !!('ontouchstart' in window);
}

jQuery(document).ready(function($) { 
  
  /* If mobile browser, prevent click on parent nav item from redirecting to URL */
  if(is_touch_device()) { 

    $('#main-menu li#your-menu-item-id').clone().prependTo('li#your-menu-item-id &amp;amp;gt; ul.sub-menu').addClass('mobile-tl');

    $('#main-menu li:not(.mobile-tl) &amp;amp;gt; ul').each(function (index, elem) {

      /* Option 1: Use this to modify the href on the &amp;lt;a&amp;gt; to # */
      $(elem).prev('a:first').attr('href' ,'#');

      /* OR Option 2: Use this to keep the href on the &amp;lt;a&amp;gt; intact but prevent the default action */
      $(elem).prev('a:first').click(function(event) {
          event.preventDefault();
      });
    });
  }
  
});
</pre>
<p>The key here is using jQuery clone, adding the class and then using the conditional for that class to disable the links. The other key is using the pseudo selector :first as well. I&#8217;m sure this could be cleaned up a bit but it works.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Mick		</title>
		<link>https://stampede-design.com/blog/dropdown-menu-hover/#comment-255</link>

		<dc:creator><![CDATA[Mick]]></dc:creator>
		<pubDate>Fri, 13 Dec 2013 16:33:56 +0000</pubDate>
		<guid isPermaLink="false">https://stampede-design.com/blog/?p=3039#comment-255</guid>

					<description><![CDATA[It is so close, if you could just make a second click on the top level link works as link to original intended page. I saw similar at isg.com, but i can&#039;t find the code that makes it work]]></description>
			<content:encoded><![CDATA[<p>It is so close, if you could just make a second click on the top level link works as link to original intended page. I saw similar at isg.com, but i can&#8217;t find the code that makes it work</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
