jbpeake
asked on
How to make jquery Galleria script autoplay
I have zero knowledge of jquery and javascript so please be patient with me on this question.
I downloaded and have successfully implemented the Galleria slideshow:
http://galleria.aino.se/
It really works great, I love it.
I would like to make it autoplay, and found this website that gives directions on how to do that.
http://stackoverflow.com/questions/2845312/galleria-auto-play-slideshow
In my very limited knowledge of java it looks like I need to paste the following code in to one of my files:
$('#galleria').galleria({
extend: function() {
this.play(4000); // will advance every 4th second
}
});
But where do I need to put this code?
This is the code as it appears on my current index.php file.
<p>
<!-- This gallery comes from: http://galleria.aino.se/download/ -->
<div id="gallery">
<img src="images/news_1.jpg">
<img src="images/news_2.jpg">
<img src="images/news_3.jpg">
<img src="images/news_4.jpg">
</div>
<script>
Galleria.loadTheme('galler ia/themes/ classic/ga lleria.cla ssic.min.j s');
$("#gallery").galleria({
width: 440,
height: 308
});
</script>
</p>
That works great, but when I add:
$('#galleria').galleria({
extend: function() {
this.play(4000); // will advance every 4th second
}
});
it stops working. So I looked around the other files to see if I needed to add that code to a different file, but I know so little java I really don't know what to do now. Any help is appreciated.
I downloaded and have successfully implemented the Galleria slideshow:
http://galleria.aino.se/
It really works great, I love it.
I would like to make it autoplay, and found this website that gives directions on how to do that.
http://stackoverflow.com/questions/2845312/galleria-auto-play-slideshow
In my very limited knowledge of java it looks like I need to paste the following code in to one of my files:
$('#galleria').galleria({
extend: function() {
this.play(4000); // will advance every 4th second
}
});
But where do I need to put this code?
This is the code as it appears on my current index.php file.
<p>
<!-- This gallery comes from: http://galleria.aino.se/download/ -->
<div id="gallery">
<img src="images/news_1.jpg">
<img src="images/news_2.jpg">
<img src="images/news_3.jpg">
<img src="images/news_4.jpg">
</div>
<script>
Galleria.loadTheme('galler
$("#gallery").galleria({
width: 440,
height: 308
});
</script>
</p>
That works great, but when I add:
$('#galleria').galleria({
extend: function() {
this.play(4000); // will advance every 4th second
}
});
it stops working. So I looked around the other files to see if I needed to add that code to a different file, but I know so little java I really don't know what to do now. Any help is appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect, thanks!
<script>
Galleria.loadTheme('galler
$("#gallery").galleria({
width: 440,
height: 308
});
</script>
To this:
<script>
Galleria.loadTheme('galler
$("#gallery").galleria({
width: 440,
height: 308,
extend: function() {
this.play(4000);
});
</script>
Note that your id "gallery" is different than the id in the code you found, "galleria".