How to add sub sub menus in wix websites - javascript

How we can add sub sub menus in wix website like as below screenshot.
multiple-sub-sub-menu

From https://support.wix.com/en/article/wix-editor-request-creating-sub-subpages-expandable-menus said that:
Currently, you cannot add sub-subpages to your site's menu to create
an expandable menu. As an alternative, you can use buttons to link to
hidden pages (the sub-subpages). That way visitors will not be able to
find the page in your site's menu, rather they will need to click a
button on the relevant sub-page to access it.

Related

WordPress Elementor Pro make nav menu widget items dropdown only

I'm recreating a Joomla site in WordPress with Elementor Pro. The site I'm recreating has a main menu bar with many of the menu items having sub-menu dropdowns. The nav menu widget has given me the ability to recreate this except for one important thing. The menu items for the Joomla site that have sub-menu dropdowns, don't themselves take you to a different page. They are only used to allow for the sub-menus to appear.
Here is an image to go along with the example below: nav-menu
So for example, if a menu item (e.g. "Donate") doesn't have a sub-menu dropdown, then clicking it will take you to its page (e.g. in this case the Donate page). But if a menu item (e.g. "Contact") does have a sub-menu dropdown, then clicking it will not take you to a different page, but the items in it's sub-menu dropdown (e.g. in this case "Visit" and "Employment") will take you to different pages.
As far as I can tell, the nav menu widget has no directly way for making a menu item be exclusively for allowing a dropdown sub-menu to appear. So I was wondering if there was a work around to allow for this.
The first thing I tried was adding this code to the custom css section for the nav menu widget:
selector .has-submenu {
pointer-events: none;
}
But this also disable the sub-menu dropdown.
The second thing I tried was creating an HTML widget with the following code:
<script>
var anchorsWithSubMenus = document.querySelectorAll(".has-submenu");
for (var i = 0; i < anchorsWithSubMenus.length; i++) {
anchorsWithSubMenus[i].href = "#"
}
</script>
But this doesn't seem to do anything. I think it's because the code executes before the nav menu HTML appears, but I'm not sure.
I realized under Appearance > Menus on my sites dashboard, I can add menu items that are Custom Links. So I added custom links that go to "#" and gave them the text that I needed.

Wordpress - script to change any level of unordered list to index of content

I have a problem creating a wordpress code that will allow me to put only parts from the entire menu on the page. I do not want to put the menu as a regular menu more like a table of contents.
The project I'm working on is available at:
http://adepol.pl/
As you can check with the help of the menu button (between search and facebook, at the top of the page) the menu has a lot of items (unfortunately the customer does not want to consolidate the menu item).
I would like to be able to get automatically (with the help of shortcode) something like on the subpage:
http://adepol.pl/tasmy/
Does anyone have any idea how to do this?
With the set elements later with css I can handle, I mean the script to extract the individual levels of the list and the sublist assigned to them.
Thank you for any ideas.
i had to do something similar once (if i understand correctly) and i used the menu shortcode plugin
https://wordpress.org/plugins/menu-shortcode/
try it out! let me know if you need more!

how can I add a second color to main menu in wordpress

I'm trying to add a contact us - as in the attached picture on a main menu in WP by creating clickable link only on the word contact and leave the phone number un-clickable. Perhaps someone can advice how it's done?
You can assign each menu item a custom class, if you use the menu builder under appearance. Then use CSS to style that menu item. If you don't see the class field, check the screen options in the upper right portion of the admin screen. Create 2 menu items, one for contact on for the #. Assign the # a class like .no-click, then use jquery to prevent default.

Toggle menu issue

I've got a toggle menu, please see http://jsfiddle.net/Wp2em/41/ for code and functions.
On the real site which is using the same code, everytime when you click on h3 (Category 1, 2 & 3 which is an a tag at the moment), it toggles its submenu down a bit, then the page changes to a new h3 linking page, and the submenu collapses together on the new page.
I'm just wondering is there any way I can tell the submenu to be open when its parent page/the new h3 linking page is opened? Please see this bank site which has the side bar effect I'd like my toggle menu to be.
Thank you in advance!
Here is my fiddle
all you will need to do is put the class "currentPage" on the li that you are currently on and the menu should be open after the page loads. I also moved some of your css around so it should move a little smoother now.
** Updated fiddle code. It will now look at your current URL and set the link that matches with it to the currentPage. Also I added that if another menu is open it will close itself if you click on another parent menu
** Updated fiddle code. Ok now if you click on the arrow the menu will expand and not go to the link(like the bank site). Also I changed it where you will have to put the anchor tag in all parent H3s.
This is not too simple. I've had a very similar problem, although I was posting the page back to the same url so I used a hidden field to store a list of the id's of the H3's which were open.
You I think will have to use a cookie to do this as you're navigating straight to the new page. The idea is you create a cookie and set a value on it every time you open an H3 and remove it every time you close it. You can use this plugin to do this. Then when you open the other page, the script reads the H3's which should be open out of the cookie and opens them.
Another route would be to use Ajax to post the open/closed H3 information back to the server which would store it in session data and use it to build the HTML of the new page so the right H3's were open.
If the page loads and the submenu (ul.second_level) is generated (i.e. from php), parse an active css class on the submenu that must be visible.
ul.active {
display: block
}
ul.second_level {
display: none
}
This is in addition to your click function. Do not trigger the click event since it starts the animation (which I presume you don't want).
Update:
It is quite basic stuff, but I do not know how the HTML code for your menu is created. If you are using php and a database (for example) to create the menu, check every submenu item with the page you are on. If the page is one of the pages in the submenu, set the class 'active' on that submenu. The CSS does the rest (displaying this submenu and hide other submenus).
If you have a static page, use javascript to check on which page you are with window.location.href for example. The rest is the same.

IFrame Inside IFrame

I am developing a retail store website and am using an html page with JavaScript. I want to use iFrames. The main page (Page1) is made up of a banner, a menu on the top and an iFrame below. For clarity I will call this iFrame1. In iFrame1 I have an html page (Page2) that contains another iFrame. I will call this iFrame2.
Page 1 has a top level menu detailing departments for example curtains, cushions, clothes etc. Selecting one of these items brings up another page (Page2) with a 2nd level menu based upon the selection within the first menu and a ListView of relevant sub headings and images pulled from the database. Making a selection from the menu in Page2 will change the “Where~ clause in the Select SQL statement and bring up different items for example types of curtains, colours of cushions, sizes available etc.
What I am looking for is a way to automatically resize both iFrames depending on the number of items that are displayed in the ListView in Page2.
Im not exactly familiar with iframe's (except for all the people telling me not to use them). So might i suggest using ajax instead with div's? (please correct me if im wrong in suggesting this)
You could define a scrollbar to appear instead of trying to automatically resize an iframe. What you're describing sounds messy though, and iframes there are many reasons why not to use iframes (http://blondish.net/iframes-why-not-to-use-them/). Try divs, and dynamically including the content?

Categories

Resources