Jump to content

Categories act strange on mobile and tablets


ramlov

Recommended Posts

Hey guys and girls,

 

hope that some of you can help me, because I am really lost, and can't google any answers or find anything here on the forum...

 

My problem is that in mobile view, I cant just tap on the box saying categories (kategorierer) to activate the dropdown. I need to hold it for some seconds, if I don't the drop down just closes immediately.

The same thing happens when I try to close it, or to open any of the subcategories.

 

Hope that you can help my

 

Best regards

Jacob

 

 

post-716976-0-21185700-1440361520_thumb.png

Link to comment
Share on other sites

Can anyone se an error in this js

function mobileInit()
{
	categoryMenu.superfish('destroy');
	$('.sf-menu').removeAttr('style');

	mCategoryGrover.on('click touchstart', function(){
		$(this).toggleClass('active').parent().find('ul.menu-content').stop().slideToggle('medium');
	});

	$('.sf-menu > li > ul').addClass('menu-mobile clearfix').parent().prepend('<span class="menu-mobile-grover"></span>');

	$(".sf-menu .menu-mobile-grover").on('click touchstart', function(){
		var catSubUl = $(this).next().next('.menu-mobile');
		if (catSubUl.is(':hidden'))
		{
			catSubUl.slideDown();
			$(this).addClass('active');
		}
		else
		{
			catSubUl.slideUp();
			$(this).removeClass('active');
		}
		return false;
	});

	
	$('#block_top_menu > ul:first > li > a').on('click touchstart', function(e){
		if ($(this).parent('li').find('ul').length)
		{
			e.preventDefault();
			var mobCatSubUl = $(this).next('.menu-mobile');
			var mobMenuGrover = $(this).next('.menu-mobile-grover');
			if (mobCatSubUl.is(':hidden'))
			{
				mobCatSubUl.slideDown();
				mobMenuGrover.addClass('active');
			}
			else
			{
				mobCatSubUl.slideUp();
				mobMenuGrover.removeClass('active');
			}
		}
	});
	
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...