Last active
August 29, 2015 14:10
-
-
Save myfashionhub/f706d8caac8370170f8a to your computer and use it in GitHub Desktop.
This file contains 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
// Require the scripts in <head> | |
// (The carousel is dependent on jQuery and jQuery UI) | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.js"></script> | |
<script src="//code.jquery.com/ui/1.10.3/jquery-ui.js"></script> | |
<script src="/path/to/fullCarousel.js"></script> | |
// IN YOUR SCRIPT FILE: | |
// Input customized slideConfig. The format for begin and end date is [yyyy, mm, dd]: | |
var slideConfig = [ | |
{ src: 'http://waywire.com/media/site/YH5PLD0V56XPX2RS/uploads/AdamLevine_HomePageSlider_1aa.png', | |
url: '//adamlevine.waywire.com', | |
begin: [2014, 11, 5], | |
end: [2020, 11, 7] | |
}, | |
{ src: 'http://waywire.com/media/site/YH5PLD0V56XPX2RS/uploads/HomePageSliderVinoVideo.jpg', | |
url: '//vinovideo.waywire.com', | |
begin: [2014, 11, 5], | |
end: [2020, 11, 7] | |
} | |
]; | |
$(document).ready(function() { | |
// carousel.init() takes three parameters: the slide config array, | |
// CSS selector of container div for the carousel | |
// and the interval at which the slides play. | |
var carousel = new Carousel(); | |
carousel.init(slideConfig, '.slideshow-container', 4000); | |
// If you schedule different slides to be played on different dates, | |
// you need to re-initialize the carousel at an interval | |
// The default interval is 43200000 milliseconds, | |
// which means the slides are recalcuated every 12 hours. | |
setInterval(function() { | |
var carousel = new Carousel(); | |
carousel.init(slideConfig, '.slideshow-container', 4000); | |
}, 43200000); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment