Last active
November 1, 2018 22:48
-
-
Save neilgee/69738b40563ac6753d2946dbb50e4ed2 to your computer and use it in GitHub Desktop.
Stick It with Waypoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_enqueue_scripts', 'prefix_in_browser' ); | |
/** | |
* Enqueuing Stick it with Waypoints | |
*/ | |
function prefix_in_browser() { | |
wp_enqueue_script( 'waypoints', get_stylesheet_directory_uri() . '/js/jquery.waypoints.min.js', array( 'jquery' ), '4.0.1', true ); | |
wp_enqueue_script( 'sticky', get_stylesheet_directory_uri() . '/js/sticky.min.js', array( 'waypoints' ), '1.0.0', true ); | |
wp_enqueue_script( 'waypoints-init', get_stylesheet_directory_uri() . '/js/waypoints.init.js', array( 'sticky' ), '1.0.0', true ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
var sticky = new Waypoint.Sticky({ | |
element: $('.header-row')[0], // Add in your CSS selector sticky target | |
direction: 'up right' | |
}) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
var sticky = new Waypoint.Sticky({ | |
element: $('.header-row')[0], // Add in your CSS selector sticky target | |
direction: 'down right' | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment