Home › Forums › JavaScript › Parent menu trigger button › Reply To: Parent menu trigger button
October 22, 2018 at 2:32 am
#277943
Participant
Thank you
with the excerpt of your code, I adapted, this line, is what I want
window.open($(this).children().attr('href'), '_self');
basically the parent has to trigger the second click, the child to the first
With the full code, can be optimized?
$(“ul#primary-menu > li.menu-item-has-children”).one(“click”, function(e) {
e.preventDefault();
return false;
});
$(“ul#primary-menu > li.menu-item-has-children”).on(“click”, function(e) {
return false;
}).dblclick(function(e) {
window.open($(this).children().attr('href'), '_self');
return false;
})
$(".sub-menu > .menu-item").one("click", function(e) {
window.open($(this).children().attr('href'), '_self');
return false;
});