Basically I want the effect to look as it does here

But mine won't do the effect I currently have a button but it won't activate the effect for the menu to pop open.

site that I'm using to test it on here

Any help would be appreciated.

I think the script classie.js which changes div's classes isn't working but I can't figure out why


There are a few problems but the main one is when sidebarEffects.js is loaded the HTML it's looking for doesn't exist yet. So...

var container = document.getElementById( 'st-container' )
// and
buttons = Array.prototype.slice.call( document.querySelectorAll( '#st-trigger-effects > button' ) )

are both empty when the script is run.

Easiest way to fix it is to put your <script> tags right before the close of your <body> tags instead of in the <head>. If you're including these files into your theme manually, no problem, just stick them in your theme's equivalent to footer.php. If you're enqueueing them, see the $in_footer param here: http://codex.wordpress.org/Function_Reference/wp_enqueue_script

You also have two containers with the id="st-trigger-effects". See here: https://html5.validator.nu/?doc=http%3A%2F%2Fchocobento.x10.mx%2Fwp%2F

  • So if I enqueue it into the footer it would solve it right? – コードバ リノ Aug 31 '15 at 2:38
  • wp_enqueue_script( 'Sidebar-Effects', get_template_directory_uri() . '/js/sidebarEffects.js', $in_footer, true ); , this isn't working though. @Will – コードバ リノ Aug 31 '15 at 4:54
  • Looks like you have the syntax wrong. Try, wp_enqueue_script( 'Sidebar-Effects', get_template_directory_uri() . '/js/sidebarEffects.js', false, '1.0', true) – Will Aug 31 '15 at 17:37
  • thanks so much! I see what you meant by entering it wrong XD @Will – コードバ リノ Sep 2 '15 at 6:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.