Divs don't toggle

Posted by stackoverflowuser on Stack Overflow See other posts from Stack Overflow or by stackoverflowuser
Published on 2010-05-13T18:04:54Z Indexed on 2010/05/13 18:14 UTC
Read the original article Hit count: 171

Filed under:
|
|
|

I have following divs on my page

 <div id="rpttimeline">div 1</div>
 <div id="rptareaview">div 2</div>
 <div id="rptgalleria">div 3</div>
 <div id="rptremainingwork">div 4</div>
 <div id="rptremainingspec">div 5</div>
 <div id="rptremainingreq">div 6</div>
 <div id="rptremaininguserstory">div 7</div>

Initially through css I have the first two divs set to visible and the remaining are hidden.

in my document ready function I have

$(document).ready(function () {
           window.setInterval(toggleDivs, 5000);
        });

function toggleDivs() {

            $('#rpttimeline').toggle();
            $('#rptareaview').toggle();
            $('#rptgalleria').toggle();
            $('#rptremainingwork').toggle();
            $('#rptremainingspec').toggle();
            $('#rptremainingreq').toggle();
            $('#rptremaininguserstory').toggle();
}

when toggledivs is called the first two divs get hidden but the other divs are not visible. It seems the toggle is affecting just the first two divs. Am I missing something here?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript