Created
June 24, 2014 01:07
-
-
Save anonymous/2fbbf2c412b302136c96 to your computer and use it in GitHub Desktop.
classe pra slideshow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="slider1"> | |
<ul class="slideshow"></ul> | |
<a href="#" class="prev">Anterior</a> | |
<a href="#" class="next">Próximo</a> | |
<div class="page"></div> | |
</div> | |
<div id="slider2"> | |
<ul class="slideshow"></ul> | |
<a href="#" class="prev">Anterior</a> | |
<a href="#" class="next">Próximo</a> | |
<div class="page"></div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Slider = function(){ | |
var slide = {}; | |
slide.add = function (parent, id, prev, next, paginator, effect, timeout){ | |
var sliderId = parent + ' '+ id; | |
var sliderPrev = parent + ' '+ prev; | |
var sliderNext = parent + ' '+ next; | |
var sliderPaginator = parent + ' '+ paginator; | |
var sliderEffect = typeof(effect) == 'undefined' ? 'fade' : effect; | |
var slidertimeout = typeof(timeout) == 'undefined' ? 5000 : timeout; | |
$(sliderId).cycle({ | |
fx : sliderEffect, | |
prev : sliderPrev, | |
next: sliderNext, | |
pager : sliderPaginator, | |
timeout : slidertimeout | |
}); | |
}; | |
return { | |
add : slide.add | |
} | |
}; | |
var sd = new Slider(); | |
sd.add('#slider1', '.slideshow', '.prev', '.next', '.paginator'); | |
sd.add('#slider2', '.slideshow', '.prev', '.next', '.paginator'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment