Forum Replies Created
-
AuthorPosts
-
March 28, 2024 at 10:18 am in reply to: Menu on mobile remains open when I return to the previous page #1438529
Hi Mike,
You’re last solution worked.
Thank you very much for you’re help Mike :)
Have a good one
March 27, 2024 at 5:07 pm in reply to: Menu on mobile remains open when I return to the previous page #1438467Hi Mike,
Thank you for your response.
No, it’s good with the button element; I found this solution to be better.
But how do I call it on a page after pasting your code in function.php?
Thank you,
- This reply was modified 8 months ago by greg47.
March 27, 2024 at 2:17 pm in reply to: Menu on mobile remains open when I return to the previous page #1438453Hello Mike,
I pasted your PHP code in function.php and deactivate the plugin.
Now I tried to call your class using a button in HTML code, but I think I’ve done something wrong. In my page, I wrote this:
<button type="button" onclick="custom_script()">Click me</button>
The button appears, but nothing happens when I click on it.
Do you know what might be causing this?
Thank you,
- This reply was modified 8 months ago by greg47.
March 26, 2024 at 4:19 pm in reply to: Menu on mobile remains open when I return to the previous page #1438360Let me explain why I made it like that.
I’ve created 15 QR codes that link to specific filters on my “/evenements” page.
When a visitor navigates to another page, I want them to retain the filter applied from the QR code when they click on the previous button. Therefore, I implemented a navigation system with this previous button.
If I simply add the ‘evenement’ page to the menu, the filter will be lost. That’s why I’ve implemented it this way.
I believe I could save the filter settings as cookies and apply them to the event menu page, but I’m not sure how to do it; it seems complicated. So, I opted for the previous button system.
March 26, 2024 at 4:07 pm in reply to: Menu on mobile remains open when I return to the previous page #1438357Hi,
Thank you for your response.
Just to provide some information:
– onclick=”window.history.back()” is a button added with a plugin.
– I dont have the issue when I’m connect to the website with my admin account. It’s only when I’m a visitorYou’re correct, if I deactivate the plugin, the menu no longer appears when I simply click on “previous”.
So, the issue arises from there.
I attempted to create a custom button previously, but encountered a bug where the button was hidden but clickable all over the page. I think it’s because I used it on all my website pages and articles. That’s why I used this plugin.
Do you think there’s a way I can keep the plugin and prevent the menu from being displayed when I click on onclick=”window.history.back()”?
If not, what HTML can I use to display a proper previous button on my page? I will use it several times on the same page, and on other pages as well.
Thank you.
March 24, 2024 at 11:40 pm in reply to: Menu on mobile remains open when I return to the previous page #1438209Hi,
Thank you for you answer,
I don’t know why but my class have changed. It works now with “.av-hamburger-inner”
It works like before if I use that : “.av-hamburger-inner”, but not with your edited code : “.av-hamburger-inner.isactive”
Nothing happens when I add the .isactive, and the previous code dont works too.
Do you know where it could come from ?
<!DOCTYPE html> <html lang="fr"> <meta charset="UTF-8"> <title>Page avec gestion du menu</title> <script> window.addEventListener('pageshow', function(event) { // Vérifier si l’événement de pageshow est une traversée de l’historique if (event.persisted) { // Masquer le menu var menuButton = document.querySelector('.av-hamburger-inner.isactive'); if (menuButton) { menuButton.click(); // Simuler un clic sur le bouton de menu pour le masquer } } }); </script> <body> <!-- Contenu de votre page ici --> <!-- Bouton du menu (à remplacer par le sélecteur réel de votre bouton de menu) --> <button class="av-hamburger-inner">Menu</button> </body> </html>
But when I click on the page when I inspect the page, I have this class :
av-hamburger av-hamburger--spin av-js-hamburger av-inserted-main-menu is-active
When i past this in the code I have only a menu button which appears, so I dont know what is the issue.Thank you
Hi,
Thank you for your help. Unfortunately, it came too late, and I ended up finding a plugin to manage filters with categories, custom fields, and tags.
I hope your response will assist others in similar situations.
Best regards,
Greg
Maybe its possible with code to lock the filter on one category, and use tags toxonomy in Masonry option ?
I found a complicated solution : Create the same tags in each category .It display well like this whith Masonry element.
But I have 50 category, So I need to create 50 tags in progress and 50 tags Closed, instead of just two. It’s a lot ! ^^- This reply was modified 8 months, 2 weeks ago by greg47.
-
AuthorPosts