Sidr Jquery Plugin & wordpress
-
Hello All,
I am new to this so please bare with me, I want to create a slide out Navigation using the primary menu. I would like to use the Sidr jquery plugin. I have attached all the necessary code including a init.js script to initialize the Sidr Plugin and the necessary .css for the template. below you will find the code that I am using in my functions.php file:
//* Enqueue Sidr and Touchwipe jQuery plugins add_action( 'wp_enqueue_scripts', 'enqueue_sidr_touchwipe' ); function enqueue_sidr_touchwipe() { wp_enqueue_script( 'sidr', get_stylesheet_directory_uri() . '/js/jquery.sidr.min.js', array( 'jquery' ), '1.0.0', true ); wp_enqueue_script( 'sidr-init', get_stylesheet_directory_uri() . '/js/jquery.sidr.min.init.js', array( 'sidr' ), '1.0.0', true ); wp_enqueue_style( 'sidr-css', get_stylesheet_directory_uri() . '/css/jquery.sidr.dark.css' ); // to make the right/left swipe touch event open or close the responsive menu wp_enqueue_script( 'touchwipe', get_stylesheet_directory_uri() . '/js/jquery.touchwipe.min.js', array( 'jquery' ), '1.0.0', true ); wp_enqueue_script( 'touchwipe-init', get_stylesheet_directory_uri() . '/js/jquery.touchwipe.min.init.js', array( 'touchwipe' ), '1.0.0', true ); }
the files include on my server are:
jquery.sidr.min.js
jquery.sidr.min.init.js :jQuery(document).ready(function($) { $('#primary-nav-link').sidr({ name: 'sidr-primary-nav', source: '#primary-nav-container' }); });
jquery.touchwipe.min.js
jquery.touchwipe.min.init.js
jquery.sidr.dark.cssis there anyone that could help me out on this issue, it would be highly appreciated.
thanks:)
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Sidr Jquery Plugin & wordpress’ is closed to new replies.