Skip to content

Instantly share code, notes, and snippets.

@neilgee neilgee/functions.php
Last active Nov 1, 2018

Embed
What would you like to do?
Stick It with Waypoint
<?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 );
}
jQuery(document).ready(function($) {
var sticky = new Waypoint.Sticky({
element: $('.header-row')[0], // Add in your CSS selector sticky target
direction: 'up right'
})
});
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
You can’t perform that action at this time.