Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

new file: loopedslider0.5.1/example-1.html

	new file:   loopedslider0.5.1/example-2.html
	new file:   loopedslider0.5.1/example-3.html
	new file:   loopedslider0.5.1/image-01.jpg
	new file:   loopedslider0.5.1/image-02.jpg
	new file:   loopedslider0.5.1/image-03.jpg
	new file:   loopedslider0.5.1/image-04.jpg
	new file:   loopedslider0.5.1/loopedslider.js
	new file:   loopedslider0.5.1/loopedslider.min.js
  • Loading branch information...
commit e6befb11c4663dff37c3081233b7e529d95638ec 1 parent 71a4d8d
@nathansearles nathansearles authored
View
56 loopedslider0.5.1/example-1.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+
+ <title>loopedSlider jQuery Plugin</title>
+
+ <script src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
+ <script src="loopedslider.js" type="text/javascript" charset="utf-8"></script>
+
+ <style type="text/css" media="screen">
+ /*
+ * Required
+ */
+ .container { width:500px; height:375px; overflow:hidden; position:relative; cursor:pointer; }
+ .slides { position:absolute; top:0; left:0; }
+ .slides div { position:absolute; top:0; width:500px; display:none; }
+ /*
+ * Optional
+ */
+ #loopedSlider,#newsSlider { margin:0 auto; width:500px; position:relative; clear:both; }
+ ul.pagination { list-style:none; padding:0; margin:0; }
+ ul.pagination li { float:left; }
+ ul.pagination li a { padding:2px 4px; }
+ ul.pagination li.active a { background:blue; color:white; }
+ </style>
+</head>
+
+<body>
+<div id="loopedSlider">
+ <div class="container">
+ <div class="slides">
+ <div><img src="image-01.jpg" width="500" height="375" alt="First Image" /></div>
+ <div><img src="image-02.jpg" width="500" height="375" alt="Second Image" /></div>
+ <div><img src="image-03.jpg" width="500" height="375" alt="Third Image" /></div>
+ <div><img src="image-04.jpg" width="500" height="375" alt="Fourth Image" /></div>
+ </div>
+ </div>
+ <a href="#" class="previous">previous</a>
+ <a href="#" class="next">next</a>
+ <ul class="pagination">
+ <li><a href="#">1</a></li>
+ <li><a href="#">2</a></li>
+ <li><a href="#">3</a></li>
+ <li><a href="#">4</a></li>
+ </ul>
+</div>
+<script type="text/javascript" charset="utf-8">
+ $(function(){
+ $('#loopedSlider').loopedSlider();
+ });
+</script>
+</body>
+</html>
View
78 loopedslider0.5.1/example-2.html
@@ -0,0 +1,78 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+
+ <title>loopedSlider jQuery Plugin</title>
+
+ <script src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
+ <script src="loopedslider.js" type="text/javascript" charset="utf-8"></script>
+
+ <style type="text/css" media="screen">
+ /*
+ * Required
+ */
+ .container { width:500px; height:375px; overflow:hidden; position:relative; cursor:pointer; }
+ .slides { position:absolute; top:0; left:0; list-style:none; padding:0; margin:0; }
+ .slides li { position:absolute; top:0; width:500px; display:none; padding:0; margin:0; }
+ /*
+ * Optional
+ */
+ #loopedSlider,#newsSlider { margin:0 auto; width:500px; position:relative; clear:both; }
+ .slides li { padding-bottom:20px; }
+ ul.pagination { list-style:none; padding:0; margin:0; }
+ ul.pagination li { float:left; }
+ ul.pagination li a { padding:2px 4px; }
+ ul.pagination li.active a { background:blue; color:white; }
+ </style>
+</head>
+
+<body>
+<div id="loopedSlider">
+ <div class="container">
+ <ul class="slides">
+ <li>
+ <h1>Slide 1</h1>
+ <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum.</p>
+ <p>Ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait.</p>
+ </li>
+ <li>
+ <h1>Slide 2</h1>
+ <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie.</p>
+ <p>Vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut.</p>
+ <p>Quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore.</p>
+ </li>
+ <li>
+ <h1>Slide 3</h1>
+ <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis.</p>
+ </li>
+ <li>
+ <h1>Slide 4</h1>
+ <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent.</p>
+ <p>Veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt.</p>
+ <p>Eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud.</p>
+ <p>Veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem.</p>
+ <p>Iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis.</p>
+ </li>
+ </ul>
+ </div>
+ <a href="#" class="previous">previous</a>
+ <a href="#" class="next">next</a>
+ <ul class="pagination">
+ <li><a href="#">1</a></li>
+ <li><a href="#">2</a></li>
+ <li><a href="#">3</a></li>
+ <li><a href="#">4</a></li>
+ </ul>
+</div>
+<script type="text/javascript" charset="utf-8">
+ $(function(){
+ $('#loopedSlider').loopedSlider({
+ autoHeight: 500
+ });
+ });
+</script>
+</body>
+</html>
View
80 loopedslider0.5.1/example-3.html
@@ -0,0 +1,80 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+
+ <title>loopedSlider jQuery Plugin</title>
+
+ <script src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
+ <script src="loopedslider.js" type="text/javascript" charset="utf-8"></script>
+
+ <style type="text/css" media="screen">
+ /*
+ * Required
+ */
+ .container { width:500px; height:375px; overflow:hidden; position:relative; cursor:pointer; }
+ div.slides { position:absolute; top:0; left:0; }
+ ul.slides { position:absolute; top:0; left:0; list-style:none; padding:0; margin:0; }
+ div.slides div,ul.slides li { position:absolute; top:0; width:500px; display:none; padding:0; margin:0; }
+ /*
+ * Optional
+ */
+ #loopedSlider,#newsSlider { margin:0 auto; width:500px; position:relative; clear:both; }
+ ul.pagination { list-style:none; padding:0; margin:0; }
+ ul.pagination li { float:left; }
+ ul.pagination li a { padding:2px 4px; }
+ ul.pagination li.active a { background:blue; color:white; }
+ </style>
+</head>
+
+<body>
+<div id="loopedSlider">
+ <div class="container">
+ <div class="slides">
+ <div><img src="image-01.jpg" width="500" height="375" alt="First Image" /></div>
+ <div><img src="image-02.jpg" width="500" height="375" alt="Second Image" /></div>
+ <div><img src="image-03.jpg" width="500" height="375" alt="Third Image" /></div>
+ <div><img src="image-04.jpg" width="500" height="375" alt="Fourth Image" /></div>
+ </div>
+ </div>
+ <a href="#" class="previous">previous</a>
+ <a href="#" class="next">next</a>
+ <ul class="pagination">
+ <li><a href="#">1</a></li>
+ <li><a href="#">2</a></li>
+ <li><a href="#">3</a></li>
+ <li><a href="#">4</a></li>
+ </ul>
+</div>
+<div id="newsSlider">
+ <div class="container">
+ <ul class="slides">
+ <li><img src="image-01.jpg" width="500" height="375" alt="First Image" /><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p></li>
+ <li><img src="image-02.jpg" width="500" height="375" alt="Second Image" /></li>
+ <li><img src="image-03.jpg" width="500" height="375" alt="Third Image" /></li>
+ <li><img src="image-04.jpg" width="500" height="375" alt="Fourth Image" /></li>
+ </ul>
+ </div>
+ <a href="#" class="previous">previous</a>
+ <a href="#" class="next">next</a>
+ <ul class="pagination">
+ <li><a href="#">1</a></li>
+ <li><a href="#">2</a></li>
+ <li><a href="#">3</a></li>
+ <li><a href="#">4</a></li>
+ </ul>
+</div>
+<script type="text/javascript" charset="utf-8">
+ $(function(){
+ $('#loopedSlider').loopedSlider({
+ autoStart: 5000
+ });
+ $('#newsSlider').loopedSlider({
+ autoHeight: 400
+ });
+ });
+</script>
+</body>
+</html>
View
BIN  loopedslider0.5.1/image-01.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  loopedslider0.5.1/image-02.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  loopedslider0.5.1/image-03.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  loopedslider0.5.1/image-04.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
195 loopedslider0.5.1/loopedslider.js
@@ -0,0 +1,195 @@
+/*
+ * loopedSlider 0.5.1 - jQuery plugin
+ * written by Nathan Searles
+ * http://code.google.com/p/loopedslider/
+ *
+ * Copyright (c) 2009 Nathan Searles (http://nathansearles.com/)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * Built for jQuery library
+ * http://jquery.com
+ *
+ */
+
+/*
+ * markup example for $("#loopedSlider").loopedSlider();
+ *
+ * <div id="loopedSlider">
+ * <div class="container">
+ * <div class="slides">
+ * <div><img src="01.jpg" alt="" /></div>
+ * <div><img src="02.jpg" alt="" /></div>
+ * <div><img src="03.jpg" alt="" /></div>
+ * <div><img src="04.jpg" alt="" /></div>
+ * </div>
+ * </div>
+ * <a href="#" class="previous">previous</a>
+ * <a href="#" class="next">next</a>
+ * <ul class="pagination">
+ * <li><a href="#">1</a></li>
+ * <li><a href="#">2</a></li>
+ * <li><a href="#">3</a></li>
+ * <li><a href="#">4</a></li>
+ * </ul>
+ * </div>
+ *
+*/
+
+(function($) {
+ $.fn.loopedSlider = function(options) {
+
+ var defaults = {
+ container: '.container',
+ slides: '.slides',
+ pagination: '.pagination',
+ containerClick: true, // Click container for next slide
+ autoStart: 0, // Set to positive number for auto interval and interval time
+ slidespeed: 300, // Speed of slide animation
+ fadespeed: 300, // Speed of fade animation
+ autoHeight: false // Set to positive number for auto height and animation speed
+ };
+
+ this.each(function() {
+
+ var obj = $(this);
+ var o = $.extend(defaults, options);
+ var pagination = $(o.pagination+' li a',obj);
+ var m = 0;
+ var t = 1;
+ var s = $(o.slides,obj).children().size();
+ var w = $(o.slides,obj).children().outerWidth();
+ var p = 0;
+ var u = false;
+ var n = 0;
+
+ $(o.slides,obj).css({width:(s*w)});
+
+ $(o.slides,obj).children().each(function(){
+ $(this).css({position:'absolute',left:p,display:'block'});
+ p=p+w;
+ });
+
+ $(pagination,obj).each(function(){
+ n=n+1;
+ $(this).attr('rel',n);
+ $(pagination.eq(0),obj).parent().addClass('active');
+ });
+
+ $(o.slides,obj).children(':eq('+(s-1)+')').css({position:'absolute',left:-w});
+
+ if(o.autoHeight){autoHeight(t);}
+
+ $('.next',obj).click(function(){
+ if(u===false) {
+ animate('next',true);
+ if(o.autoStart){clearInterval(sliderIntervalID);}
+ } return false;
+ });
+
+ $('.previous',obj).click(function(){
+ if(u===false) {
+ animate('prev',true);
+ if(o.autoStart){clearInterval(sliderIntervalID);}
+ } return false;
+ });
+
+ if (o.containerClick) {
+ $(o.container ,obj).click(function(){
+ if(u===false) {
+ animate('next',true);
+ if(o.autoStart){clearInterval(sliderIntervalID);}
+ } return false;
+ });
+ }
+
+ $(pagination,obj).click(function(){
+ if ($(this).parent().hasClass('active')) {return false;}
+ else {
+ t = $(this).attr('rel');
+ $(pagination,obj).parent().siblings().removeClass('active');
+ $(this).parent().addClass('active');
+ animate('fade',t);
+ if(o.autoStart){clearInterval(sliderIntervalID);}
+ } return false;
+ });
+
+ if (o.autoStart) {
+ sliderIntervalID = setInterval(function(){
+ if(u===false) {animate('next',true);}
+ }, o.autoStart);
+ }
+
+ function current(t) {
+ if(t===s+1){t=1;}
+ if(t===0){t=s;}
+ $(pagination,obj).parent().siblings().removeClass('active');
+ $(pagination+'[rel="' + (t) + '"]',obj).parent().addClass('active');
+ };
+
+ function autoHeight(t) {
+ if(t===s+1){t=1;}
+ if(t===0){t=s;}
+ var getHeight = $(o.slides,obj).children(':eq('+(t-1)+')',obj).outerHeight();
+ $(o.container,obj).animate({height: getHeight},o.autoHeight);
+ };
+
+ function animate(dir,clicked){
+ u = true;
+ switch(dir){
+ case 'next':
+ t = t+1;
+ m = (-(t*w-w));
+ current(t);
+ if(o.autoHeight){autoHeight(t);}
+ $(o.slides,obj).animate({left: m}, o.slidespeed,function(){
+ if (t===s+1) {
+ t = 1;
+ $(o.slides,obj).css({left:0},function(){$(o.slides,obj).animate({left:m})});
+ $(o.slides,obj).children(':eq(0)').css({left: 0});
+ $(o.slides,obj).children(':eq('+(s-1)+')').css({ position:'absolute',left:-w});
+ }
+ if (t===s) $(o.slides,obj).children(':eq(0)').css({left:(s*w)});
+ if (t===s-1) $(o.slides,obj).children(':eq('+(s-1)+')').css({left:s*w-w});
+ u = false;
+ });
+ break;
+ case 'prev':
+ t = t-1;
+ m = (-(t*w-w));
+ current(t);
+ if(o.autoHeight){autoHeight(t);}
+ $(o.slides,obj).animate({left: m}, o.slidespeed,function(){
+ if (t===0) {
+ t = s;
+ $(o.slides,obj).children(':eq('+(s-1)+')').css({position:'absolute',left:(s*w-w)});
+ $(o.slides,obj).css({left: -(s*w-w)});
+ $(o.slides,obj).children(':eq(0)').css({left:(s*w)});
+ }
+ if (t===2 ) $(o.slides,obj).children(':eq(0)').css({position:'absolute',left:0});
+ if (t===1) $(o.slides,obj).children(':eq('+ (s-1) +')').css({position:'absolute',left:-w});
+ u = false;
+ });
+ break;
+ case 'fade':
+ t = [t]*1;
+ m = (-(t*w-w));
+ current(t);
+ if(o.autoHeight){autoHeight(t);}
+ $(o.slides,obj).children().fadeOut(o.fadespeed, function(){
+ $(o.slides,obj).css({left: m});
+ $(o.slides,obj).children(':eq('+(s-1)+')').css({left:s*w-w});
+ $(o.slides,obj).children(':eq(0)').css({left:0});
+ if(t===s){$(o.slides,obj).children(':eq(0)').css({left:(s*w)});}
+ if(t===1){$(o.slides,obj).children(':eq('+(s-1)+')').css({ position:'absolute',left:-w});}
+ $(o.slides,obj).children().fadeIn(o.fadespeed);
+ u = false;
+ });
+ break;
+ default:
+ break;
+ }
+ };
+ });
+ };
+})(jQuery);
View
11 loopedslider0.5.1/loopedslider.min.js
@@ -0,0 +1,11 @@
+/*
+ * loopedSlider 0.5.1 - jQuery plugin
+ * written by Nathan Searles
+ * http://code.google.com/p/loopedslider/
+ *
+ * Copyright (c) 2009 Nathan Searles (http://nathansearles.com/)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ */
+(function($){$.fn.loopedSlider=function(options){var defaults={container:'.container',slides:'.slides',pagination:'.pagination',containerClick:true,autoStart:0,slidespeed:300,fadespeed:300,autoHeight:false};this.each(function(){var obj=$(this);var o=$.extend(defaults,options);var pagination=$(o.pagination+' li a',obj);var m=0;var t=1;var s=$(o.slides,obj).children().size();var w=$(o.slides,obj).children().outerWidth();var p=0;var u=false;var n=0;$(o.slides,obj).css({width:(s*w)});$(o.slides,obj).children().each(function(){$(this).css({position:'absolute',left:p,display:'block'});p=p+w});$(pagination,obj).each(function(){n=n+1;$(this).attr('rel',n);$(pagination.eq(0),obj).parent().addClass('active')});$(o.slides,obj).children(':eq('+(s-1)+')').css({position:'absolute',left:-w});if(o.autoHeight){autoHeight(t)}$('.next',obj).click(function(){if(u===false){animate('next',true);if(o.autoStart){clearInterval(sliderIntervalID)}}return false});$('.previous',obj).click(function(){if(u===false){animate('prev',true);if(o.autoStart){clearInterval(sliderIntervalID)}}return false});if(o.containerClick){$(o.container,obj).click(function(){if(u===false){animate('next',true);if(o.autoStart){clearInterval(sliderIntervalID)}}return false})}$(pagination,obj).click(function(){if($(this).parent().hasClass('active')){return false}else{t=$(this).attr('rel');$(pagination,obj).parent().siblings().removeClass('active');$(this).parent().addClass('active');animate('fade',t);if(o.autoStart){clearInterval(sliderIntervalID)}}return false});if(o.autoStart){sliderIntervalID=setInterval(function(){if(u===false){animate('next',true)}},o.autoStart)}function current(t){if(t===s+1){t=1}if(t===0){t=s}$(pagination,obj).parent().siblings().removeClass('active');$(pagination+'[rel="'+(t)+'"]',obj).parent().addClass('active')};function autoHeight(t){if(t===s+1){t=1}if(t===0){t=s}var getHeight=$(o.slides,obj).children(':eq('+(t-1)+')',obj).outerHeight();$(o.container,obj).animate({height:getHeight},o.autoHeight)};function animate(dir,clicked){u=true;switch(dir){case'next':t=t+1;m=(-(t*w-w));current(t);if(o.autoHeight){autoHeight(t)}$(o.slides,obj).animate({left:m},o.slidespeed,function(){if(t===s+1){t=1;$(o.slides,obj).css({left:0},function(){$(o.slides,obj).animate({left:m})});$(o.slides,obj).children(':eq(0)').css({left:0});$(o.slides,obj).children(':eq('+(s-1)+')').css({position:'absolute',left:-w})}if(t===s)$(o.slides,obj).children(':eq(0)').css({left:(s*w)});if(t===s-1)$(o.slides,obj).children(':eq('+(s-1)+')').css({left:s*w-w});u=false});break;case'prev':t=t-1;m=(-(t*w-w));current(t);if(o.autoHeight){autoHeight(t)}$(o.slides,obj).animate({left:m},o.slidespeed,function(){if(t===0){t=s;$(o.slides,obj).children(':eq('+(s-1)+')').css({position:'absolute',left:(s*w-w)});$(o.slides,obj).css({left:-(s*w-w)});$(o.slides,obj).children(':eq(0)').css({left:(s*w)})}if(t===2)$(o.slides,obj).children(':eq(0)').css({position:'absolute',left:0});if(t===1)$(o.slides,obj).children(':eq('+(s-1)+')').css({position:'absolute',left:-w});u=false});break;case'fade':t=[t]*1;m=(-(t*w-w));current(t);if(o.autoHeight){autoHeight(t)}$(o.slides,obj).children().fadeOut(o.fadespeed,function(){$(o.slides,obj).css({left:m});$(o.slides,obj).children(':eq('+(s-1)+')').css({left:s*w-w});$(o.slides,obj).children(':eq(0)').css({left:0});if(t===s){$(o.slides,obj).children(':eq(0)').css({left:(s*w)})}if(t===1){$(o.slides,obj).children(':eq('+(s-1)+')').css({position:'absolute',left:-w})}$(o.slides,obj).children().fadeIn(o.fadespeed);u=false});break;default:break}}})}})(jQuery);
Please sign in to comment.
Something went wrong with that request. Please try again.