So I'm trying to include waypoints.js in my wordpress page but I can't figure it out why it is not working.
I got this in my functions.php inside my theme (and I put noframework.waypoints.min.js inside the js folder):
function waypoints_init() {
wp_enqueue_script( 'waypointsJS', get_template_directory_uri() . '/js/noframework.waypoints.min.js', array('jquery'), true);
}
add_action('wp_enqueue_scripts', 'waypoints_init');
Then I wrote:
function waypointTrigger() {
echo '<script>
jQuery(document).ready(function() {
var waypoint = new Waypoint({
element: document.getElementById("triggerPointId"),
handler: function() {
alert("Basic waypoint triggered");
}
});
})
</script>';
}
add_action('wp_footer', 'waypointTrigger');
and still when I scroll down to the point where the element with ID mentioned above is located I get nothing at all.
Where did I make a mistake?