-
AuthorPosts
-
June 26, 2020 at 11:32 am #1225769
Hi there,
i have the exactly same Problem shown in this thread: https://kriesi.at/support/topic/burger-menu-on-scroll/
I copied the Ajax and the CSS. The problem: It does change on scroll, but my Burger is visible together with the main menu.
And how can i get the Burger to the top, in the middle of the blue field?
Thanks, your Theme is just great!
June 30, 2020 at 9:13 am #1226658Hi,
i did it myself now somehow.
My problem ist now, how can i make sure that on mobile and tablet, the menu ist alway a burger symbol?
And how do i get the burger symbol in Desktop-Mode to the top right ?Thanks
*P.S. you can answer in german or english.
- This reply was modified 4 years, 6 months ago by surfklaus.
June 30, 2020 at 12:41 pm #1226718Hi,
Thank you for the inquiry.
You might have to wrap the custom css code inside a css media query so that it’s only loaded on large screens.
@media only screen and (min-width: 1024px) { /* Add your Desktop Styles here */ }
And also prevent the script from executing by creating a condition that checks for the current width of the browser view port.
if($(window).width() > 1024) { avia_scroll_top_menu(); } else { // no way jose }
`
Best regards,
IsmaelJune 30, 2020 at 2:16 pm #1226750Hi Ismael,
thx you very much for your help, Ismael! :-)
This doesn’t work for me.
Following problem: at the moment i have a horizontal navigation. You can see ist on the page. When the User scrolls down, i have a Burger Symbol. That works. So far so good!But i want the Burger Symbol on the top, left beside the search symbol.
On Tablet or Mobile, i want exclusively the Burger Symbol. And is there a way, that i can have on specific Pages (Shop, Cart etc.) only the Burger Symbol as well?best regards
KlausP.S. where should your script go? In the function.php?
- This reply was modified 4 years, 6 months ago by surfklaus.
July 4, 2020 at 10:21 am #1227894Hi,
Any other ideas?July 6, 2020 at 8:53 am #1228222Hi,
Sorry for the delay. You have to include the script in the snippet that we provided previously and wrap the css code with the css media query. Please post the login details in the private field so that we can test the modifications. Make sure that the Appearance > Editor panel is accessible.
css media query:
@media only screen and (min-width: 1024px) { .responsive #top .av-main-nav .menu-item { display: block; } .responsive #top .av-main-nav .menu-item-avia-special { display: block; } .responsive .av-burger-menu-main.hide_burger_show_menu { display: block; } #avia-menu .hide_menu_show_burger { display: none !important; } #header.av_header_transparency .av-burger-menu-main.hide_burger_show_menu { display: none !important; } #header.av_header_transparency .av-burger-menu-main:not(.hide_burger_show_menu) { display: none !important; } }
script:
add_action('wp_footer', 'ava_burger_toggle_on_scroll'); function ava_burger_toggle_on_scroll(){ ?> <script type="text/javascript"> (function($) { function avia_scroll_top_menu() { var win = $(window), menu = $('.responsive #top .av-main-nav .menu-item'), burger = $('.responsive #top .av-main-nav .menu-item-avia-special, .responsive .av-burger-menu-main'), set_status = function() { var st = win.scrollTop(); if(st > 100) { menu.addClass('hide_menu_show_burger'); menu.removeClass('hide_burger_show_menu'); burger.removeClass('hide_menu_show_burger'); burger.addClass('hide_burger_show_menu'); } else if(menu.is('.hide_menu_show_burger')) { burger.addClass('hide_menu_show_burger'); burger.removeClass('hide_menu_show_burger'); menu.removeClass('hide_menu_show_burger'); menu.addClass('hide_burger_show_menu'); } }; win.on( 'scroll', function(){ window.requestAnimationFrame( set_status )} ); set_status(); } if($(window).width() > 1024) { avia_scroll_top_menu(); } })(jQuery); </script> <?php }
Best regards,
IsmaelJuly 9, 2020 at 11:44 am #1229120Ismael, thank you very very much for your patience!
If you could test ist… it is not really working for me.best regards
KlausJuly 10, 2020 at 12:02 pm #1229393Hi,
Thank you for the update.
We edited the functions.php file a bit — this line:
if($(window).width() > 1366) { avia_scroll_top_menu(); }
The scroll effect should only take effect when the screen width is more than 1366px, and if not the default mobile menu will be shown. If you’re testing this on a browser emulation, you have to refresh the page in order to see the expected behavior.
Best regards,
IsmaelJuly 10, 2020 at 12:21 pm #1229401Great Ismael, thank you! 😊
One more thing. How can show only the burger on specific pages? Without scrolling. The Burger should be the Standard-Menu on this sites – Shop, Cart etc..
I tried with conditional comments, but it didn’t work.best regards
KlausJuly 13, 2020 at 4:26 pm #1229985Hi,
any clues to show only the Burger Symbol on Shop and Cart Page?
best regards
KlausJuly 14, 2020 at 6:29 am #1230168Hi,
Thank you for the update.
You can use this css code to hide the main menu on a specific page and only display the burger icon.
.page-id-209 #avia-menu .menu-item { display: none !important; } .page-id-209 .av-burger-menu-main { display: block !important; }
Just replace the number 209 with the actual ID of the shop or cart page.
Best regards,
IsmaelJuly 14, 2020 at 8:09 am #1230198Ismael, thank you very much!
It works fine on the Cart Page. But remember, we worked out, that the Burger is shown when the User scrolls down.
And so there is no menu and when the User scrolls, the Burger is shown.How can i disable, that the User must scroll to see the Burger on this specific pages?
best regards
Klaus- This reply was modified 4 years, 5 months ago by surfklaus.
July 14, 2020 at 9:40 am #1230241P.S.
on the Productpage, i had to change the code to.woocommerce-page #avia-menu .menu-item{ display: none !important; } .woocommerce-page .av-burger-menu-main{ display: block !important; }
But i have to scroll to show the Burger…
July 16, 2020 at 7:24 am #1230847Hi,
Thank you for the update.
Did you remove the account above? We tried to access the dashboard again using that account, but it’s not valid anymore.
We might have to add another condition to the script so that it won’t get applied on certain pages.
if($(window).width() > 1366 || ! $('body').is('.woocommerce-page, .page-id-209') ) { avia_scroll_top_menu(); }
This checks if the body container contains the class names “.woocommerce-page” or “.page-id-209”. Please adjust the selectors if necessary.
Best regards,
IsmaelJuly 23, 2020 at 2:18 pm #1232598Hi Ismael,
sorry for being late. I was ill.
Everything changed and the customer is on a complete new way.This Thread can be closed.
Again, thank you very much for the personal support!best regards
KlausJuly 23, 2020 at 5:28 pm #1232695Hi surfklaus,
Great :)
We are closing the thread.
If you need further assistance please let us know in a new one.
Best regards,
Victoria -
AuthorPosts
- The topic ‘Burger when scrolling down’ is closed to new replies.