-
Notifications
You must be signed in to change notification settings - Fork 501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't seelct the top level nav item #156
Comments
Yep, that's the problem! Also parent level inaccessible on mobile devices fix //dropdown fix, motherfuckers
function isTouchDevice(){
if ('ontouchstart' in window || navigator.msMaxTouchPoints) {
$('html').addClass('touch');
}
}
//run touch test
isTouchDevice(); //touch detedt
$("html:not(.touch) li.dropdown>a.dropdown-toggle").on("click",function(){
window.location = $(this).attr("href"); //click parent non-touch
});
$("html.touch li.dropdown>a.dropdown-toggle").on("click",function(){
//if already clicked once - go to link(submenu is already opened)
if($(this).hasClass("oneTouch")){
$(this).removeClass("oneTouch");
window.location = $(this).attr("href");
}
else{
$(this).addClass("oneTouch"); //add click counter
$(".navbar-nav li ul").hide(); //<---- hide all submenus, use your own menu selector
$(this).parent().find(".dropdown-menu").show();
}
}); |
I had to add the
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have used the file in a similar way to http://www.balibaytradingcompany.com/ at www.plymouthdevils.co, but can't select the top level nav item
The text was updated successfully, but these errors were encountered: