Off Canvas Push Widget For Side Menu

The code in this tutorial pushes the site container to the right when the side widget is toggled open.

The solution includes an animated hamburger menu icon enabling you to open and close the side widget area which in this example, is populated with the custom menu widget and some address HTML.

Update See this version for use with themes that use a fixed site header.

Here’s the demo video showing how it works :

Demo Video 1#

This method uses the .toggleClass method.

Demo Video 2

This method uses the .animate method.

Code Installation

There’s 3 steps :

Step 1 – From the download folder, upload the file named toggle.js to your child themes root directory.

Step 2 – From the download folder, copy & paste the PHP code from the functions.php file to the end of your child themes functions file.

Step 3 – From the download folder, copy & paste the CSS from the style.css file to the end of your child themes style.css file and clear caching.

You can then add widgets to the Side Menu widget area.

Register or login to access the download folder for members :

Related Tutorials


Comments

4 responses to “Off Canvas Push Widget For Side Menu”

  1. Jennifer Andrew Avatar
    Jennifer Andrew

    Thank you for the tutorial! Is there any way to get the menu to slide out from the right side of the screen?

    1. Yes however you would need to modify the code to do that. Which theme are you using?

      1. Jennifer Andrew Avatar
        Jennifer Andrew

        Thanks for the reply and alternate method! I will check it out. For this tutorial, I’m using the Genesis Sample theme.

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.