- Posts: 12
- Thank you received: 0
OnClick Dropdown Menu
-
artform
Inactive member - Topic Author
- New Member
Less
More
10 years 11 months ago #36059
by artform
OnClick Dropdown Menu was created by artform
Dear HotThemes staff,
I'm using the Hotel template since last year and I'm really satisfied.
There is only one little issue with the topmenu when I'm navigating on a Tablet or mobile device, since there is no "onmouseover" I'm not able to access the submenuitems.
Is there any chance to find a workaround to get a "onclick" dropdown menu? I appreciate any thought on this matter!
This is the website I'm working on: www.gutshofbrandis.com
Sincerly
Simon
I'm using the Hotel template since last year and I'm really satisfied.
There is only one little issue with the topmenu when I'm navigating on a Tablet or mobile device, since there is no "onmouseover" I'm not able to access the submenuitems.
Is there any chance to find a workaround to get a "onclick" dropdown menu? I appreciate any thought on this matter!
This is the website I'm working on: www.gutshofbrandis.com
Sincerly
Simon
Please Log in to join the conversation.
-
ivan.milic
Support Staff - Moderator
Less
More
- Posts: 14116
- Thank you received: 1639
10 years 11 months ago - 10 years 11 months ago #36063
by ivan.milic
Replied by ivan.milic on topic OnClick Dropdown Menu
Yes but problem then is if you reserve click for opening sub menu you then can not use root menu items as links.
Anyway here is change:
In index.php of template find:
modify like this:
Anyway here is change:
In index.php of template find:
Code:
function mainmenu(){
jQuery("#nav ul").css({display: "none"}); // Opera Fix
jQuery("#nav li").hover(function(){
jQuery(this).find('ul:first').css({visibility: "visible",display: "none"}).<?php echo $menuAnimationEffect; ?>;
},function(){jQuery(this).find('ul:first').css({visibility: "hidden"});
});
}
modify like this:
Code:
function mainmenu(){
jQuery("#nav ul").css({display: "none"}); // Opera Fix
jQuery("#nav li").hover(function(){
jQuery(this).find('ul:first').css({visibility: "visible",display: "none"}).<?php echo $menuAnimationEffect; ?>;
},function(){jQuery(this).find('ul:first').css({visibility: "hidden"});
});
jQuery("#nav li:has(UL)").click(function(e){
e.preventDefault();
jQuery(this).trigger('hover');
});
}
Last edit: 10 years 11 months ago by ivan.milic.
Please Log in to join the conversation.
-
artform
Inactive member - Topic Author
- New Member
Less
More
- Posts: 12
- Thank you received: 0
10 years 11 months ago #36091
by artform
Replied by artform on topic OnClick Dropdown Menu
Thank you for this approach,
the "onclick" submenu actually works and it wouldn't be a problem that the First level menu Items wouldn't be linked.
The main problem is that also the Sub-menu Items are not linked anymore. So I had to go back to the standard script.
Do you have any idea how to exclude sub-menu items from this rule.
Or maybe is there a complete different approach to solve this problem and make hot menu more mobile friendly?
Thanks again
Simon
the "onclick" submenu actually works and it wouldn't be a problem that the First level menu Items wouldn't be linked.
The main problem is that also the Sub-menu Items are not linked anymore. So I had to go back to the standard script.
Do you have any idea how to exclude sub-menu items from this rule.
Or maybe is there a complete different approach to solve this problem and make hot menu more mobile friendly?
Thanks again
Simon
Please Log in to join the conversation.
-
ivan.milic
Support Staff - Moderator
Less
More
- Posts: 14116
- Thank you received: 1639
10 years 11 months ago #36103
by ivan.milic
Replied by ivan.milic on topic OnClick Dropdown Menu
Change:
jQuery("#nav li:has(UL)")
to:
jQuery("#nav > li:has(UL)")
jQuery("#nav li:has(UL)")
to:
jQuery("#nav > li:has(UL)")
Please Log in to join the conversation.
-
artform
Inactive member - Topic Author
- New Member
Less
More
- Posts: 12
- Thank you received: 0
10 years 11 months ago #36119
by artform
Replied by artform on topic OnClick Dropdown Menu
Hello, the submenu links are still not working when I add this change. Any other idea?
Thanks!!
Thanks!!
Please Log in to join the conversation.
-
ivan.milic
Support Staff - Moderator
Less
More
- Posts: 14116
- Thank you received: 1639
10 years 11 months ago #36131
by ivan.milic
Replied by ivan.milic on topic OnClick Dropdown Menu
I'am not clear what is problem with first solution I gave you?
Please Log in to join the conversation.
Time to create page: 0.168 seconds