Navigation
4 posters
Page 1 of 1
Navigation
I've looked everywhere but I can't even find where they have the generated navbar. I'm trying to remove and edit them.
https://sirchivas.forumotion.com/
AwesomeBB
The css and javascript that I found here didn't work to remove them. ex. "groups, calendar."
https://sirchivas.forumotion.com/
AwesomeBB
The css and javascript that I found here didn't work to remove them. ex. "groups, calendar."
Last edited by Sir Chivas™ on February 29th 2024, 12:47 am; edited 1 time in total
Razor12345- Support Moderator
- Posts : 1586
Reputation : 268
Language : Ukr, Rus, Eng
Location : Ukraine
Re: Navigation
Ah, I kept putting: (code works perfectly)
And if I'd like to add a new navigation link?
#main-menu ul a[href="/calendar"]
And if I'd like to add a new navigation link?
Re: Navigation
AP - Modules - Javascript code management - Create new Javascript
Title: any
Placement: In all the pages
Code:
In this code:
- button that opens the navigation menu
- code that looks for additional links in the navigation menu. If these links are found, the code will not allow these links to be inserted into the navigation menu again.
- the place where the navigation buttons are inserted
- code that inserts the HTML markup of our links. If you need to insert more than one link in the navigation menu, use the following code as an example:
Using this HTML markup of link will preserve the default link style in the navigation menu.
Result:
Title: any
Placement: In all the pages
Code:
- Code:
$(function() {
const menuButton = document.querySelector('#main-menu-btn');
menuButton.addEventListener('click', function() {
const extraLink = document.querySelector('.extra_link');
const isOpenMenu = document.querySelector('#main-menu div.divider + ul');
if (isOpenMenu && !extraLink) {
isOpenMenu.insertAdjacentHTML('beforeend', '<li class="extra_link"><a href="/"><span>Extra link<span></a></li>');
}
});
});
In this code:
|
|
|
|
|
Using this HTML markup of link will preserve the default link style in the navigation menu.
Result:
Razor12345- Support Moderator
- Posts : 1586
Reputation : 268
Language : Ukr, Rus, Eng
Location : Ukraine
Re: Navigation
Thank you for your help and time to actually explain how the Script works. Ever think about open a teaching class of JS here at FM?
Ape and Razor12345 like this post
Re: Navigation
Problem solved & topic archived.
|
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum