자바스크립트 

           <script>                    
                        function pop_scroll()
                        {               
                            interval = setInterval("pop_view()", 10000);                      
                        }
                        
                        function pop_view(){                         
                                var id = "";                           
                                for(j = 1; j <3; j++){
                                    id = "divName_"+ j;                             
                                     disp = document.getElementById(id).style.display;    
                                              
                                     if(disp == "block"){
                                          if(j == 1 ) {
                                              document.getElementById("divName_1").style.display = "none";
                                              document.getElementById("divName_2").style.display = "block";
                                              
                                              break;
                                          }                                       
                                           if(j == 2 ) {
                                              document.getElementById("divName_1").style.display = "block";
                                              document.getElementById("divName_2").style.display = "none";
                                              
                                              break;
                                          }
                                          
                                         
                                        
                                     }
                                }           
             }
             
              pop_scroll();
                        
       </script>

 

div적용

 <div id="divName_1" style="display:block" >첫번째 보여질 DIV </div>

 <div id="divName_2" style="display:none" >두번째 보여질 DIV </div>   
   

출처 무시해도 될 만큼 사소한 건 없다。 | 그루밍
원문 http://eyesi.me/110097754772

+ Recent posts