i loading "jquery.waypoints.min.js" (seems load correctly when network analysis tool), nothing happens simple script:
$(document).ready(function() { $('#footer').waypoint(function() { $('body').addclass("foo"); }); }); i trying hours ...
btw. loading scripts per functions-php in wordpress:
function add_js_scripts() { wp_deregister_script('jquery'); wp_register_script('jquery', "http" . ($_server['server_port'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js", false, null); wp_enqueue_script('jquery'); wp_enqueue_script('waypoints', get_stylesheet_directory_uri() . '/waypoints/lib/jquery.waypoints.min.js'); } add_action('wp_enqueue_scripts', 'add_js_scripts');
waypoints run when scroll past element. can never happen footer, on page. can add offset work around this.
$(document).ready(function() { $('#footer').waypoint(function() { $('body').addclass("foo"); }, { offset: 'bottom-in-view' }); }); the waypoint run when bottom of footer element within view. set offset '100%' run if any of footer element in view.
Comments
Post a Comment