Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: viljamis/ResponsiveSlides.js
base: 1dd116ee2d
...
head fork: viljamis/ResponsiveSlides.js
compare: 1cc5418420
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
View
4 README.md
@@ -1,4 +1,4 @@
-# ResponsiveSlides.js v1.3
+# ResponsiveSlides.js v1.31
### Simple & lightweight responsive slider plugin (in 1kb)
@@ -52,6 +52,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
Changelog
======
+v1.31 (2012-05-02) - Easier to use callbacks (+ optional "active" class for the next/prev buttons when animating slides. If you need this functionality, open the unminified version and search for "Adds active class during slide animation" and remove comments around it).
+
v1.3 (2012-04-26) - Three new options: "random", "pause", "pauseControls" + small bug fixes.
v1.25 (2012-04-19) - No more flashing of unstyled slideshow before JS has loaded. Adds also better support for cases when JavaScript isn't available.
View
9 demo/demo.html
@@ -31,14 +31,11 @@
pager: false,
nav: true,
speed: 500,
- namespace: "callbacks"
- }).bind({
- // Before callback
- "callbacks-before": function () {
+ namespace: "callbacks",
+ before: function () {
$('.events').append("<li>before event fired.</li>");
},
- // After callback
- "callbacks-after": function () {
+ after: function () {
$('.events').append("<li>after event fired.</li>");
}
});
View
21 responsiveslides.js
@@ -1,4 +1,4 @@
-/*! ResponsiveSlides.js v1.3
+/*! ResponsiveSlides.js v1.31
* http://responsiveslides.com
* http://viljamis.com
*
@@ -25,7 +25,9 @@
"nextText": "Next", // String: Text for the "next" button
"maxwidth": "", // Integer: Max-width of the slideshow, in pixels
"controls": "", // Selector: Where controls should be appended to, default is after the <ul>
- "namespace": "rslides" // String: change the default namespace used
+ "namespace": "rslides", // String: change the default namespace used
+ before: function () {}, // Function: Before callback
+ after: function () {} // Function: After callback
}, options);
return this.each(function () {
@@ -69,7 +71,7 @@
// Fading animation
slideTo = function (idx) {
- $this.trigger(namespace + "-before");
+ settings.before();
$slide
.stop()
.fadeOut(fadeTime, function () {
@@ -81,8 +83,8 @@
.fadeIn(fadeTime, function () {
$(this)
.addClass(visibleClass)
- .css(visible)
- .trigger(namespace + "-after");
+ .css(visible);
+ settings.after();
index = idx;
});
};
@@ -256,6 +258,15 @@
return;
}
+ // Adds active class during slide animation
+ // $(this)
+ // .addClass(namespace + "_active")
+ // .delay(fadeTime)
+ // .queue(function (next) {
+ // $(this).removeClass(namespace + "_active");
+ // next();
+ // });
+
// Determine where to slide
var idx = $slide.index($("." + visibleClass)),
prevIdx = idx - 1,
View
12 responsiveslides.min.js
@@ -1,6 +1,6 @@
-/*! http://responsiveslides.com v1.3 by @viljamis */
-(function(d,D,w){d.fn.responsiveSlides=function(i){var b=d.extend({auto:!0,speed:1E3,timeout:4E3,pager:!1,nav:!1,random:!1,pause:!1,pauseControls:!1,prevText:"Previous",nextText:"Next",maxwidth:"",controls:"",namespace:"rslides"},i);return this.each(function(){w++;var c=d(this),o,q,j,l,m,n=0,e=c.children(),x=e.size(),r=parseFloat(b.speed),y=parseFloat(b.timeout),s=parseFloat(b.maxwidth),g=b.namespace,h=g+w,f=g+"_nav "+h+"_nav",t=g+"_here",k=h+"_on",z=h+"_s",p=d("<ul class='"+g+"_tabs "+h+"_tabs' />"),
-A={"float":"left",position:"relative"},E={"float":"none",position:"absolute"},u=function(a){c.trigger(g+"-before");e.stop().fadeOut(r,function(){d(this).removeClass(k).css(E)}).eq(a).fadeIn(r,function(){d(this).addClass(k).css(A).trigger(g+"-after");n=a})};b.random&&(e.sort(function(){return Math.round(Math.random())-0.5}),c.empty().append(e));e.each(function(a){this.id=z+a});c.addClass(g+" "+h);i&&i.maxwidth&&c.css("max-width",s);e.hide().eq(0).addClass(k).css(A).show();if(1<e.size()){if(y<r+100)return;
-if(b.pager){var v=[];e.each(function(a){a=a+1;v=v+("<li><a href='#' class='"+z+a+"'>"+a+"</a></li>")});p.append(v);m=p.find("a");i.controls?d(b.controls).append(p):c.after(p);o=function(a){m.closest("li").removeClass(t).eq(a).addClass(t)}}b.auto&&(q=function(){l=setInterval(function(){var a=n+1<x?n+1:0;b.pager&&o(a);u(a)},y)},q());j=function(){if(b.auto){clearInterval(l);q()}};b.pause&&c.hover(function(){clearInterval(l)},function(){j()});b.pager&&(m.bind("click",function(a){a.preventDefault();b.pauseControls||
-j();a=m.index(this);if(!(n===a||d("."+k+":animated").length)){o(a);u(a)}}).eq(0).closest("li").addClass(t),b.pauseControls&&m.hover(function(){clearInterval(l)},function(){j()}));if(b.nav){f="<a href='#' class='"+f+" prev'>"+b.prevText+"</a><a href='#' class='"+f+" next'>"+b.nextText+"</a>";i.controls?d(b.controls).append(f):c.after(f);var f=d("."+h+"_nav"),B=d("."+h+"_nav.prev");f.bind("click",function(a){a.preventDefault();if(!d("."+k+":animated").length){var c=e.index(d("."+k)),a=c-1,c=c+1<x?n+
-1:0;u(d(this)[0]===B[0]?a:c);b.pager&&o(d(this)[0]===B[0]?a:c);b.pauseControls||j()}});b.pauseControls&&f.hover(function(){clearInterval(l)},function(){j()})}}if("undefined"===typeof document.body.style.maxWidth&&i.maxwidth){var C=function(){c.css("width","100%");c.width()>s&&c.css("width",s)};C();d(D).bind("resize",function(){C()})}})}})(jQuery,this,0);
+/*! http://responsiveslides.com v1.31 by @viljamis */
+(function(d,D,v){d.fn.responsiveSlides=function(h){var b=d.extend({auto:!0,speed:1E3,timeout:4E3,pager:!1,nav:!1,random:!1,pause:!1,pauseControls:!1,prevText:"Previous",nextText:"Next",maxwidth:"",controls:"",namespace:"rslides",before:function(){},after:function(){}},h);return this.each(function(){v++;var e=d(this),n,p,i,k,l,m=0,f=e.children(),w=f.size(),q=parseFloat(b.speed),x=parseFloat(b.timeout),r=parseFloat(b.maxwidth),c=b.namespace,g=c+v,y=c+"_nav "+g+"_nav",s=c+"_here",j=g+"_on",z=g+"_s",
+o=d("<ul class='"+c+"_tabs "+g+"_tabs' />"),A={"float":"left",position:"relative"},E={"float":"none",position:"absolute"},t=function(a){b.before();f.stop().fadeOut(q,function(){d(this).removeClass(j).css(E)}).eq(a).fadeIn(q,function(){d(this).addClass(j).css(A);b.after();m=a})};b.random&&(f.sort(function(){return Math.round(Math.random())-0.5}),e.empty().append(f));f.each(function(a){this.id=z+a});e.addClass(c+" "+g);h&&h.maxwidth&&e.css("max-width",r);f.hide().eq(0).addClass(j).css(A).show();if(1<
+f.size()){if(x<q+100)return;if(b.pager){var u=[];f.each(function(a){a=a+1;u=u+("<li><a href='#' class='"+z+a+"'>"+a+"</a></li>")});o.append(u);l=o.find("a");h.controls?d(b.controls).append(o):e.after(o);n=function(a){l.closest("li").removeClass(s).eq(a).addClass(s)}}b.auto&&(p=function(){k=setInterval(function(){var a=m+1<w?m+1:0;b.pager&&n(a);t(a)},x)},p());i=function(){if(b.auto){clearInterval(k);p()}};b.pause&&e.hover(function(){clearInterval(k)},function(){i()});b.pager&&(l.bind("click",function(a){a.preventDefault();
+b.pauseControls||i();a=l.index(this);if(!(m===a||d("."+j+":animated").length)){n(a);t(a)}}).eq(0).closest("li").addClass(s),b.pauseControls&&l.hover(function(){clearInterval(k)},function(){i()}));if(b.nav){c="<a href='#' class='"+y+" prev'>"+b.prevText+"</a><a href='#' class='"+y+" next'>"+b.nextText+"</a>";h.controls?d(b.controls).append(c):e.after(c);var c=d("."+g+"_nav"),B=d("."+g+"_nav.prev");c.bind("click",function(a){a.preventDefault();if(!d("."+j+":animated").length){var c=f.index(d("."+j)),
+a=c-1,c=c+1<w?m+1:0;t(d(this)[0]===B[0]?a:c);b.pager&&n(d(this)[0]===B[0]?a:c);b.pauseControls||i()}});b.pauseControls&&c.hover(function(){clearInterval(k)},function(){i()})}}if("undefined"===typeof document.body.style.maxWidth&&h.maxwidth){var C=function(){e.css("width","100%");e.width()>r&&e.css("width",r)};C();d(D).bind("resize",function(){C()})}})}})(jQuery,this,0);

No commit comments for this range

Something went wrong with that request. Please try again.