How can I make the images on my site appear to rotate/spin in a way similar to a spinning helix (not sure of term)? I want the images to change-and change position, when a user scrolls. Here is a link to a spinning helix. (https://media1.giphy.com/media/3o7520F8VcFddZh2zm/giphy.gif?cid=790b76116354422bb61690c576ef59201c52c4ecacfe433d&rid=giphy.gif)
Here is a link to my page to illustrate what I'm trying to make rotate/spin. (https://wirkkalaj.wixsite.com/timetoh/test-page) I've looked up several tutorials on image behavior when a user scrolls, but I have not found anything exactly like what I need...or I just can't make it work! I'm wondering if the effect can be achieved with css & javascript or if I need to consider flash?
So far I have mostly just tried this script (link below), or variations of this script=(Image change on scroll) I am having major difficulties so far. I am not very familiar with javascript and I keep getting lost. I know HTML & CSS, & Photoshop. Can somebody help me out with a method or a script that will work? Or at least point me in the right direction? FYI I am using wix as my web editor. Thanks fasho
// Array of images to swap between
var images = [];
// Add 200 items to array
for (i = 0; i < 200; i++) {
images.push('http://placekitten.com/' + (100 + i) + '/' + (100 + i));
}
var totalImages = images.length;
var pageHeight = $(document).height() - $(window).height();
// Work out how often we should change image (i.e. how far we scroll between changes)
var scrollInterval = Math.floor(pageHeight / totalImages);
$(document).scroll(function() {
// Which one should we show at this scroll point?
i = Math.floor($(this).scrollTop() / scrollInterval);
// Show the corresponding image from the array
$('img').attr('src', images[i]);
$('b').text('Frame: ' + i);
});
img,
b {
position: fixed;
top: 0;
left: 0;
}
body {
height: 10000px;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<img src="http://placekitten.com/100/100" /><b>Frame: 0</b>