I have a slide show of captions that move on side arrow clicks, and I need to change an image in the page once certain captions (labeled by individual ID's) hit position().left === 0.
I am able to get their location through .position().left, but that only happens upon load. How can I get the program to always listen for location? scrollLeft() doesn't work due to the nature of the scrolling settings and an interval does not give me the precision I want.
if ((($('#captionthree').position()).left) === 0) {
//removes initial image
$("img").remove('#imgone');
//appends the new image
$('#imagecontainer').append('<img id="imgtwo">');
}
I'm doing this on top of fullpage.js, if that paints a better picture.
Any help is appreciated!!