/*
 * Marquee Left
 * This plugin only scrolls images left continuously,
 * It also resizes the target element to fit all of the images, but the target height must be defined
 * 
 * Modify & redistribute this script as you see fit.
 *
 */
(function($) {
  $.fn.marquee = function(options) {
    return this.each(function() {
      var defaults = {
        duration  : 15000 // milliseconds
      };
      var opts = $.extend({}, defaults, options);
      var marquee = $(this);
      marquee.css({ overflow:'hidden', position:'relative' });
      var e = marquee.wrapInner("<span>").find('span');
      e.css({ display:'block', position:'absolute', top:0 });
      var w = e.width(), h = e.height();
      var c = e.clone().appendTo(e); // now there are two spans with "My Text"
      c.css('left', w);
      marquee.wrapInner("<div>").css('height', h);
      // marquee.find("div").css("width", "200%");
      var reset = function() {
        $(this).css('left', 0)
        .animate({ "left": -w+'px' }, opts.duration, 'linear', reset);
      };
      reset.call(e);
    });
  };
})(jQuery);
