Slide through multiple jsp pages using jquery not working if interval time is set greater then 30000

I have created a fucntion that slides through a defined array of jsp pages after a set works fine when the interval time is set <= 30000 i.e 30 seconds.But as soon I change it to 40/50/60 seconds, the pages won’t slide and the page stops refreshing in order to load the next page in array.
here is the javascript code.

<script type="text/javascript" charset="utf-8">
    var sites = [
    var currentSite = sites.length;

    $(document).ready(function () {
        var $iframe = $("iframe").attr("src","./MapMain.jsp");
        setInterval(function() {
            (currentSite == 0) ? 
                currentSite = sites.length - 1 : currentSite = currentSite -1;
<style type="text/css" media="screen">
iframe {
  height: 100%;
  width: 100%;
  border: none;

Source: jsp

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.