• Resolved eaferrari24

    (@eaferrari24)


    Hello! I have been working with the Enigma theme by Weblizar for quite some time and I am completely stumped with a bug that has existed since using it in late 2014. In Windows 8, the primary buttons of the main menu work perfectly, however the secondary menu items (sub-menu) are non-responsive to touch input.

    This occurs across IE, Firefox, and Chrome and I have no clue how to fix it. This bug is also affecting the demo site (https://demo.weblizar.com/preview/#enigma) and can be replicated on non touch devices (even on Mac OS X) by opening chrome’s developer tools, selecting the device icon in the top left corner of tools window and changing the device to “Laptop with Touch”

    Every once in a while, spamming the sub-menu item will allow a click-through, but I have not found a way to use it to my advantage during debugging.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter eaferrari24

    (@eaferrari24)

    I’ve tried to solve this using various touch debugging tools and nothing does the trick. Touch based Windows devices are becoming more popular and I would really like to have this mystery solved. Any tips? Thanks!

    hi,

    create a child theme first and after it create menu.js file into child theme directory now copy the below code and paste into menu.js file

    jQuery(document).ready(function() {
    		var bMobile;  // true if in mobile mode
    		var isMobile;
    		// Initiate event handlers
    		function init() {
    			var isMobile = {
    				Android: function() {
    					return navigator.userAgent.match(/Android/i);
    				},
    				BlackBerry: function() {
    					return navigator.userAgent.match(/BlackBerry/i);
    				},
    				iOS: function() {
    					return navigator.userAgent.match(/iPhone|iPad|iPod/i);
    				},
    				Opera: function() {
    					return navigator.userAgent.match(/Opera Mini/i);
    				},
    				Windows: function() {
    					return navigator.userAgent.match(/IEMobile/i);
    				},
    				any: function() {
    					return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
    				}
    			};
    
    			var oMenus = jQuery('.navbar-nav  .dropdown'),nTimer;
    			if( isMobile.any() ) {
    				// Set up menu on click for Mobile and ipad mode
    				oMenus.on({
    				  'mouseenter touchstart': function(event) {
    					event.preventDefault();
    					clearTimeout(nTimer);
    					oMenus.removeClass('open');
    					jQuery(this).addClass('open').slideDown();
    				  },});
    				jQuery('ul.dropdown-menu li a').on('click touchend', function() {
    					var link = jQuery(this).attr('href');
    					window.open(link,'_self'); // opens in new window as requested
    					return false; // prevent anchor click
    				});
    			} else {
    				oMenus.on({'mouseenter touchstart': function(event) {
    					event.preventDefault();
    					clearTimeout(nTimer);
    					oMenus.removeClass('open');
    					jQuery(this).addClass('open').slideDown();
    					},
    					'mouseleave': function() {
    					nTimer = setTimeout(function() {
    					oMenus.removeClass('open');
    					}, 500);
    					}
    				});
    			}
    		}
    		jQuery(document).ready(function() {
    		  // Your other code to run on DOM ready...
    			jQuery(".nav .dropdown-toggle").click(function () {
    			window.location = jQuery(this).attr('href');
    			});
    		  init();
    		});
    		jQuery(window).resize(init);
    	});

    And enqueue menu.js in Child theme’s functions.php file.
    Save the changes.
    Thanks

    Thread Starter eaferrari24

    (@eaferrari24)

    Hi weblizar_support! Thank you for trying to help. Unfortunately, this addition to the code does not fix the bug.

    To elaborate on the issue, Windows devices with both touch and mouse support are unable to use the touchscreen to select sub-menu items on the navigation. This can be very easily simulated using Chrome Developer Tools which indicates this is an issue with how the menu works and how Windows 8, 8.1, and 10 handle both touch and mouse input simultaneously.

    This issue is also apparent with the Weblizar Chronicle Premium theme that appears to be sharing much of the navigation menu code with Enigma. (https://demo.weblizar.com/preview/#chronicle)

    It is also a bug on every Enigma/Enigma Premium based WordPress site I have been able to find.

    Please, I highly recommend that you take advantage of Chrome Developer Tools and the issue will become apparent right away. You can follow this short guide and replace “Google Nexus 5” with “Laptop with Touch” in the dropdown list. https://developers.google.com/web/tools/setup/device-testing/devtools-emulator

    Any other ideas?

    Hi,

    Please create child theme and create menu.js in child theme directory. Copy below code in menu.js

    jQuery(document).ready(function() {
    		var bMobile;  // true if in mobile mode
    		var isMobile;
    		// Initiate event handlers
    		function init() {
    			var isMobile = {
    				Android: function() {
    					return navigator.userAgent.match(/Android/i);
    				},
    				BlackBerry: function() {
    					return navigator.userAgent.match(/BlackBerry/i);
    				},
    				iOS: function() {
    					return navigator.userAgent.match(/iPhone|iPad|iPod/i);
    				},
    				Opera: function() {
    					return navigator.userAgent.match(/Opera Mini/i);
    				},
    				Windows: function() {
    					return navigator.userAgent.match(/IEMobile/i);
    				},
    				any: function() {
    					return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
    				}
    			};
    
    			var oMenus = jQuery('.navbar-nav  .dropdown'),nTimer;
    			if( isMobile.any() ) {
    				// Set up menu on click for Mobile and ipad mode
    				oMenus.on({
    				  'mouseenter touchstart': function(event) {
    					event.preventDefault();
    					clearTimeout(nTimer);
    					oMenus.removeClass('open');
    					jQuery(this).addClass('open').slideDown();
    				  },});
    				jQuery('ul.dropdown-menu li a').on('click touchend', function() {
    					var link = jQuery(this).attr('href');
    					window.open(link,'_self'); // opens in new window as requested
    					return false; // prevent anchor click
    				});
    			} else {
    				oMenus.on({'mouseenter touchstart': function(event) {
    					event.preventDefault();
    					clearTimeout(nTimer);
    					oMenus.removeClass('open');
    					jQuery(this).addClass('open').slideDown();
    					},
    					'mouseleave': function() {
    					nTimer = setTimeout(function() {
    					oMenus.removeClass('open');
    					}, 500);
    					}
    				});
    			}
    		}
    		jQuery(document).ready(function() {
    		  // Your other code to run on DOM ready...
    			jQuery(".nav .dropdown-toggle").click(function () {
    			window.location = jQuery(this).attr('href');
    			});
    		  init();
    		});
    		jQuery(window).resize(init);
    	});

    Save the file.
    Now create functions.php and copy below code in it.

    <?php
    function child_js(){
    	 wp_enqueue_script('menu_js',  get_stylesheet_directory_uri() .'/menu.js', array('jquery'));
    }
    add_action('wp_enqueue_scripts', 'child_js');
    ?>

    Save the changes.
    Thanks

    Thread Starter eaferrari24

    (@eaferrari24)

    Hi weblizar_support! Thank you for the response. From what I can tell, your second reply has the same code as your original post.

    Thread Starter eaferrari24

    (@eaferrari24)

    Seems like this issue has been resolved as of the menu.js rewrite in Enigma 2.0

    Thank you so much for listening to feedback!

    Hi,

    Most welcome.

    Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘No Menu Touch Response in Windows 8 (Enigma Theme)’ is closed to new replies.