- This topic has 64 replies, 5 voices, and was last updated 5 years ago by Tom.
-
AuthorPosts
-
May 23, 2018 at 8:45 pm #583152TomLead DeveloperLead Developer
The element exists on your page now, so we’re getting closer.
Now they say to add this javascript. You can add it into the “wp_footer” hook inside GP Hooks:
<script> // Look for .hamburger var hamburger = document.querySelector(".hamburger"); var menuToggle = document.querySelector( '.menu-toggle' ); // On click menuToggle.addEventListener("click", function() { // Toggle class "is-active" hamburger.classList.toggle("is-active"); // Do something else, like open/close menu }); </script>
May 23, 2018 at 11:59 pm #583242liorsade8nothing…
May 24, 2018 at 12:01 am #583246liorsade8please please please tom – try it in your test empty site
and let us (generatepress see the code for success)…
i’m sure the way we do it now isnt good – maybe some mistakes i make or so….
please update,
thanksMay 24, 2018 at 8:55 pm #584113TomLead DeveloperLead DeveloperWe’re actually really close to getting it to work on your site. However, the HTML has disappeared again. Did you change anything?
I know it’s a lot of back and forth, but we’re close to having it solved, we just need to HTML to stay in place 🙂
May 25, 2018 at 10:31 am #584590liorsade8hi tom,
everything is the same… didnt do something….
here is the print screen of the system:snippet screenshot:
https://prnt.sc/jmlgjfeditor screenshot:
https://prnt.sc/jmlhzgftp screenshot:
https://prnt.sc/jmlidphooks screenshot:
https://prnt.sc/jmlhnzcss screenshot:
https://prnt.sc/jmlhjpalso,
as i said – i can give you code / ftp / access to the site…
please update,
thanksMay 25, 2018 at 1:49 pm #584717LeoStaffCustomer SupportThe javascript should be in
wp_footer
hook as per Tom’s suggestion here:
https://generatepress.com/forums/topic/animated-hamburger-icon/page/3/#post-583152May 25, 2018 at 1:51 pm #584720liorsade8hi
sorry,
done.
but still nothing…May 25, 2018 at 1:57 pm #584722liorsade8by the way…. with this code in the snippet
add_action( ‘generate_inside_mobile_menu’, ‘tu_hamburger_icon’ ); function tu_hamburger_icon() { ?> <div class="hamburger hamburger--collapse"> <div class="hamburger-box"> <div class="hamburger-inner"></div> </div> </div> <?php }
it doesnt even show a menu in mobile…..
May 25, 2018 at 4:27 pm #584786TomLead DeveloperLead DeveloperAhh, you have some funky quotes in there.
Use this instead:
add_action( 'generate_inside_mobile_menu', 'tu_hamburger_icon' ); function tu_hamburger_icon() { ?> <div class="hamburger hamburger--collapse"> <div class="hamburger-box"> <div class="hamburger-inner"></div> </div> </div> <?php }
May 25, 2018 at 4:29 pm #584787liorsade8OMMMMMMMMMMMMMMGGGGGGGGGGGGG
tom u are friiikkkking amazing!
it’s working!
take a loooookMay 25, 2018 at 4:31 pm #584788liorsade8btw – i removed the snippet and put it in the function…
it’s workingMay 25, 2018 at 4:36 pm #584790TomLead DeveloperLead DeveloperLooks great! 🙂
May 25, 2018 at 4:37 pm #584791liorsade8yes. you are the best guys!!
i think you should put an article or something to u’r users about it – it’s upgrading everything!also,
now i’ll try to put text near it (MENU) and float left right and tweak it…
thanks for now!May 25, 2018 at 5:24 pm #584802liorsade8hi tom,
few things:1.
i removed the code for font awesome in the functions.php
and it’s still working… so why should i keep the code?add_action( ‘wp_head’, ‘tu_font_awesome_css’ );
function tu_font_awesome_css() {
echo ‘<link rel=”stylesheet” href=”https://use.fontawesome.com/releases/v5.0.9/css/all.css” integrity=”sha384-5SOiIsAziJl6AWe0HWRKTXlfcSHKmYV4RBF18PPJ173Kzn7jzMyFuTtk8JA7QQG1″ crossorigin=”anonymous”>’;
}also turned off better font awesome…. and it’s working…
so why should i keep the code… or not?2. it’s working once i have normal pages in the site… and not a one page scrolling site – take a look at mobile… press and once you open it and press a page (scrolling in section 2 or 3 for example) the hamburger doesnt goes back to none active…. and press few times – u will see it’s messing it all up …
do u know the code for bringing it back?thanks
May 25, 2018 at 6:28 pm #584814liorsade8hi,
also another question:
what is better? to put this code into the gp-hooks:<link href=”http://menuhamburgerstest.s178.upress.link/wp-content/themes/generatepress_child/dist/hamburgers.css” rel=”stylesheet”>
or to put the entire css
all of what’s in here:
https://github.com/jonsuh/hamburgers/blob/master/dist/hamburgers.css
in the css in the site?are they the same?
which will load faster or downgrade the site in speed ranks and stuff
or it doesnt matter?thanks
-
AuthorPosts
- The topic ‘Animated Hamburger Icon’ is closed to new replies.