Hi @Richard,
thank you so much for your help and kind words. All works perfectly fine now. It's lots of fun working with lay theme! 😍
Best, Miriam
miriamb
Posts
-
Collapse mobile navigation after click -
Collapse mobile navigation after clickHi Richard,
yes, I deleted the upper part of the script. It probably duplicated the default settings in the theme and was the reason for the interference. It works fine now.
<script>
jQuery(document).ready(function(){jQuery(document).on("click", ".mobile-nav ul li a", function(event) {
jQuery(".mobile-nav").removeClass('active');
jQuery(".mobile-nav").css('transform','translateY(-180px)');
});});
</script>But as usual a new problem appeared. 😅 If an item is clicked in the menu and the menu is disappeared, the "close-x" remains (see screenshot). Instead, the burger menu should appear again. Do you have an idea how to solve this?
Thanks for your help again,
Miriam -
Site title as reload button for one page websiteHi @fr! Sooo cool, thank you very much for this easy solution, it works right away. 💪💪💪 You helped me a lot, thanks again.
-
Collapse mobile navigation after clickHello,
I am building a very simple one-pager with three anchors that you can jump to in the menu. That also works quite fine with the mobile burger navigation. But I want the navigation to close after a menu item has been clicked.
To close the navigation after clicking on one menu item I used some code line I found here:
http://laythemeforum.com:4567/topic/4005/collapse-mobile-nav-on-click-menu-item butBut sadly the suggested solution doesn't work as expected. It actually messes up the scrollTo action, so now it scrolls up to the top and than to the anchor. And I don't understand why. I also tried the suggested toggleClass, but it worked even less.
This is the script I have in Custom HTML at bottom:
<script>
jQuery(document).ready(function(){
jQuery('body').on('click', 'li.menu-item > a', function(event) {
event.preventDefault();
var id = jQuery(this).attr('href');
jQuery('html, body').animate( { scrollTop: jQuery(id).offset().top }, 750 );
});jQuery(document).on("click", ".mobile-nav ul li a", function(event) {
jQuery(".mobile-nav").removeClass('active');
jQuery(".mobile-nav").css('transform','translateY(-180px)');
});
});
</script>This is the link to the page I am talking about: http://wendelstein-steuerberatung.de
I am very much looking forward to your answer.
Best regards, Miriam -
Site title as reload button for one page websiteHello,
im currently building a very simple one pager with three anchors to jump to in the menu.
As an alternative to the "back to top"-button at the end of the page i'd like to use the site title as a reload/refresh button. From what I understand the refresh function on the homepage is disabled. I'd be happy if you could point me to some work around on that problem.I found a post with quite the similar problem I think, but sadly no suggested solution there (http://laythemeforum.com:4567/topic/656/site-title-link-only-works-once-on-homepage/6).
This is the link to the site im talking about: http://wendelstein-steuerberatung.de
Im really looking forward to your answer.
Best, Miriam