My goal is to create a dynamic animation using jquery/javascript. I have an image that is 2000px wide and 200px tall, and I want to animate it from left to right, creating a panoramic view by scrolling back and forth continuously.
I attempted to implement the [script][1] I found online, but it only moves in one direction. What I am looking for is more of a Panning effect. Any suggestions or advice would be greatly appreciated. Thank you!
Here is the direct link to the code: http://www.jqueryscript.net/demo/jQuery-Plugin-To-Create-Auto-Scrolling-Background-AutoBackgroundScroll-js/js/autoBackgroundScroll.js
;(function(){
$.fn.autoBackgroundScroll = function(options) {
var opts = $.extend({}, $.fn.autoBackgroundScroll.defaults, options);
var $backslider = $(this);
var duration = opts.duration;
var speed = opts.speed;
var imageWidth = opts.imageWidth;
var imageHeight = opts.imageHeight;
var direction1 = opts.direction1;
var direction2 = opts.direction2;
var posX = 0;
var posY = 0;
// [...] (Remaining code omitted for brevity)
})(jQuery);
Code source: http://www.jqueryscript.net/animation/jQuery-Plugin-To-Create-Auto-Scrolling-Background-AutoBackgroundScroll-js.html