Browse Source

Merge remote-tracking branch 'upstream/master'

Conflicts:
	responsiveslides.js
pull/2/head
Tuomas Salo 13 years ago
parent
commit
5ea6815334
  1. 21
      responsiveslides.js

21
responsiveslides.js

@ -1,7 +1,6 @@
/*! ResponsiveSlides.js v1.01. (c) 2011 Viljami Salminen. MIT License. http://responsive-slides.viljamis.com */ /*! ResponsiveSlides.js v1.01. (c) 2011 Viljami Salminen. MIT License. http://responsive-slides.viljamis.com */
(function ($) { (function ($) {
$.fn.responsiveSlides = function (options) { $.fn.responsiveSlides = function (options) {
// Settings // Settings
var settings = { var settings = {
'speed' : 4000, 'speed' : 4000,
@ -13,13 +12,11 @@
return this.each(function () { return this.each(function () {
var $this = $(this); var $this = $(this);
if (options) { if (options) {
$.extend(settings, options); $.extend(settings, options);
} }
var slideshow = function () { var slideshow = function () {
var $slide = $this.find('img'), var $slide = $this.find('img'),
// just for minification: // just for minification:
@ -54,9 +51,7 @@
'position': 'absolute' 'position': 'absolute'
}); });
$this.find(':first-child') $this.find(':first-child').addClass(namespace_prefix + '_visible').css(visible);
.addClass(namespace_prefix + '_visible')
.css(visible);
$this.css({ $this.css({
'max-width': parseFloat(settings.maxwidth), 'max-width': parseFloat(settings.maxwidth),
@ -74,8 +69,7 @@
$(this).css(hidden); $(this).css(hidden);
}).next($slide).fadeIn(fade, function () { }).next($slide).fadeIn(fade, function () {
$(this).css(visible); $(this).css(visible);
}).addClass(namespace_prefix + '_visible').end().appendTo($this) }).addClass(namespace_prefix + '_visible').end().appendTo($this).removeClass(namespace_prefix + '_visible');
.removeClass(namespace_prefix + '_visible');
}, parseFloat(settings.speed)); }, parseFloat(settings.speed));
// Auto: false // Auto: false
@ -109,22 +103,17 @@
$('.' + namespace_prefix + '_visible').stop() $('.' + namespace_prefix + '_visible').stop()
.fadeOut(fade, function () { .fadeOut(fade, function () {
$(this) $(this).removeClass(namespace_prefix + '_visible').css(hidden);
.removeClass(namespace_prefix + '_visible')
.css(hidden);
}).end(); }).end();
$('#' + namespace_prefix + '_slide' + i).stop() $('#' + namespace_prefix + '_slide' + i).stop()
.fadeIn(fade, function () { .fadeIn(fade, function () {
$(this) $(this).addClass(namespace_prefix + '_visible').css(visible);
.addClass(namespace_prefix + '_visible')
.css(visible);
}).end(); }).end();
$el.parent().addClass(namespace_prefix + '_active'); $el.parent().addClass(namespace_prefix + '_active');
} }
}); });
}); });
} }
}; };
@ -148,12 +137,10 @@
// Call once // Call once
slideshow(); slideshow();
widthSupport(); widthSupport();
// Call on resize // Call on resize
$(window).resize(function () { $(window).resize(function () {
widthSupport(); widthSupport();
}); });
}); });
}; };
})(jQuery); })(jQuery);
Loading…
Cancel
Save