Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Parent menu trigger button Reply To: Parent menu trigger button

#277943
vulkanus
Participant

@chris_2080

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;    

});