Hi All,
I am trying to get JQuery Slideshow working on a website.
I just can't seem to get it to work, the images are not rotating, merely tile over one another, no effects.
Here is my code as it is now.
Homepage.php - Javascript requirements
function init() {
parent::init();
Requirements::Javascript("mysite/javascript/slideshow.js");
Requirements::Javascript("mysite/javascript/jquery.js");
Requirements::customScript("
$(document).ready(function() {
$('#slideshow').slideshow({
timeout: 2000,
type: 'random',
pauselink: 'pause1',
pausecallback: function(self){
self.html('Play')
},
playcallback: function(self){
self.html('Pause');
}
});
$('#slideshow2').slideshow({
timeout: 2000,
type: 'sequence',
pauselink: 'pause2'
});
});
");
}
Homepage.ss - The Slideshow HTML
<div id="slideshow">
<a href="1"><img src="/../../../assets/darksideofthemoon.jpg" alt="" /></a>
<a href="2"><img src="/../../../assets/absolution.jpg" alt="" /></a>
<a href="3"><img src="/../../../assets/acertaintrigger.jpg" alt="" /></a>
<a href="4"><img src="/../../../assets/liberationtransmission.jpg" alt="" /></a>
<a href="5"><img src="/../../../assets/americanidiot.jpg" alt="" /></a>
</div>
I'm still a little clueless when it come to using Javascript with Silverstripe. Am I doing this right? If not, can anyone show me the exact way to implement this?
Thanks