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('galleria/themes/classic/galleria.classic.min.js');
          $("#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.
jbpeakeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tom BeckCommented:
What if you change this:

<script>
    Galleria.loadTheme('galleria/themes/classic/galleria.classic.min.js');
          $("#gallery").galleria({
                        width: 440,
                        height: 308        
          });
</script>

To this:

<script>
    Galleria.loadTheme('galleria/themes/classic/galleria.classic.min.js');
          $("#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".
0
Tom BeckCommented:
Oops, not enough curly braces:

<script>
    Galleria.loadTheme('galleria/themes/classic/galleria.classic.min.js');
          $("#gallery").galleria({
                        width: 440,
                        height: 308,
                        extend: function() {
                            this.play(4000);
                        }      
          });
</script>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jbpeakeAuthor Commented:
Perfect, thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.