zipporays aka The Architect February 2016

JQuery not working in JADE?

I was making a simple slideshow for my site and it seems that my JQuery doesn't get executed. Here's the code:

   div#slideshow

              img(src="/images/img1.png")

              img(src="/images/img2.png")

              img(src="/images/img3.png")

              img(src="/images/img4.png")

             script(type='text/javascript').
                $("#slideshow > div:gt(0)").hide();
                setInterval(function() { 
                $('#slideshow > div:first')
                    .fadeOut(1000)
                    .next()
                    .fadeIn(1000)
                    .end()
                    .appendTo('#slideshow');
                 },  3000);

I'm running NodeJS with Express

Answers


narainsagar February 2016

Include jQuery before that <script>

script(src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js")

You may install it locally and change path according to.. and whatever version it depends upon you!

Post Status

Asked in February 2016
Viewed 1,256 times
Voted 10
Answered 1 times

Search




Leave an answer