2016-02-04 5 views
0

У меня есть некоторые вертикальные вкладки, которые меняют содержимое в ящике. Verticle Box verticle box 2Bootstrap Vertical Tabs auto change

Я хотел бы эти вкладки для автоматического изменения сами по себе и не могу показаться, чтобы заставить его работать.

Вот мой код:

<div class="media"> 
         <div class="parrent pull-left"> 
          <ul class="nav nav-tabs nav-stacked"> 
           <li class=""><a href="#tab1" data-toggle="tab" class="analistic-01">Architect</a></li> 
           <li class=""><a href="#tab2" data-toggle="tab" class="analistic-02">AIA</a></li> 
           <li class=""><a href="#tab3" data-toggle="tab" class="tehnical">IRS </a></li> 
           <li class=""><a href="#tab4" data-toggle="tab" class="tehnical">AKIN GUMP</a></li> 
           <li class=""><a href="#tab5" data-toggle="tab" class="tehnical">PWC</a></li> 
           <li class=""><a href="#tab6" data-toggle="tab" class="tehnical">EPA</a></li> 
          </ul> 
         </div> 

         <div class="parrent media-body"> 
          <div class="tab-content"> 
           <div class="tab-pane fade" id="tab1"> 
            <div class="media"> 
             <div class="pull-left boxImg"> 
              <a href="http://www.architectmagazine.com/awards/r-d-awards/award-green-zip-tape_o"><img class="img-responsive" src="images/Awards/R&D.png"></a> 
             </div> 
             <div class="media-body"> 
              <h2>Architect Magazine</h2> 
              <p>It’s hard to get simpler in conception and execution than Green-Zip Tape. The product is a substitute for the joint-compound tape that has been used between gypsum board panels since the introduction of prefabricated plasterboard in the early 1930s. The product impressed all three jurors.</p> 
             </div> 
            </div> 
           </div> 

           <div class="tab-pane fade active in" id="tab2"> 
            <div class="media"> 
             <div class="pull-left boxImg"> 
              <a href="http://info.aia.org/aiarchitect/thisweek07/1005/1005n_epa.htm"><img class="img-responsive" src="images/Awards/AIA.png"></a> 
             </div> 
             <div class="media-body"> 
              <h2>AIA Awards</h2> 
              <p>This patented demountable tape provides an alternative method for hanging sheetrock for future de-construction and reuse. 
              </p> 
             </div> 
            </div> 
           </div> 

           <div class="tab-pane fade" id="tab3"> 
            <div class="media"> 
             <div class="pull-left boxImg"> 
              <a href="https://www.irs.gov/pub/irs-wd/1404001.pdf"><img class="img-responsive" src="images/Awards/IRS.png"></a> 
             </div> 
             <div class="media-body"> 
              <h2>IRS Awards</h2> 
              <p>Taxpayer's Zip type partitions installed within the Owned Property and Leased Property are included in asset class 57.0 of Rev. Proc. 87-56 for purposes of § 168. 
              </p> 
             </div> 
            </div> 
           </div> 

           <div class="tab-pane fade" id="tab4"> 
            <div class="media"> 
             <div class="pull-left boxImg"> 
              <a href="https://www.akingump.com/en/news-insights/david-burton-examines-irs-private-letter-ruling-on-drywall.html"><img class="img-responsive" src="images/Awards/AkinGump.png"></a> 
             </div> 
             <div class="media-body"> 
              <h2>Akin Gump Awards</h2> 
              <p style="font-size: 12px;">The article analyzes an IRS ruling that says that zip system drywall is eligible for more favorable depreciation than conventional system drywall, despite the fact that each serves the same purpose and has a comparable cost. Burton also looks at the opportunities this creates for real estate developers and the implications for certain nontraditional real estate investment trusts. 
              </p> 
             </div> 
            </div> 
           </div> 

           <div class="tab-pane fade" id="tab5"> 
            <div class="media"> 
             <div class="pull-left boxImg"> 
              <a href="http://www.pwc.com/us/en/tax-accounting-services/newsletters/accounting-methods/new-rulings-provide-guidance-tax-accounting-method-issues.html"><img class="img-responsive" src="images/Awards/PWC.png"></a> 
             </div> 
             <div class="media-body"> 
              <h2>PWC Awards</h2> 
              <p style="font-size: 12px;">IRS rules on the depreciation classification of certain interior, nonloadbearing partitions 
              The IRS, in PLR 201404001, ruled that zip-type partitions installed within owned andleased property must be included in asset class 57.0 of Rev. Proc. 87-56 under Section 168, and that conventional drywall partitions are classified as non-residential real property under Section 168(e)(2)(B). 

              </p> 
             </div> 
            </div> 
           </div> 

           <div class="tab-pane fade" id="tab6"> 
            <div class="media"> 
             <div class="pull-left boxImg"> 
              <a href="http://www3.epa.gov/region9/waste/solid/construction/lifecyclebuilding/#win"><img class="img-responsive" src="images/Awards/US.png"></a> 
             </div> 
             <div class="media-body"> 
              <h2>EPA Awards</h2> 
              <p>Winner: Green-Zip-TapeTM Demountable Tape Drywall tape attachment system to support easy deconstruction and reuse 
              </p> 
             </div> 
            </div> 
           </div> 
          </div> 
          <!--/.tab-content--> 
         </div> 
         <!--/.media-body--> 
        </div> 
        <!--/.media--> 

Пожалуйста, ничего бы помочь! Как вы можете видеть, как пользователь нажимает на вкладки слева, изменяется содержимое вправо. Я хотел бы пройти через вкладки с интервалом в 5 секунд.

Спасибо!

Вот вторая коробка:

<div class="col-xs-12 col-sm-6 wow fadeInDown"> 
       <div class="tab-wrap"> 
        <div class="media"> 
         <div class="parrent pull-left"> 
          <ul class="nav nav-tabs nav-stacked"> 
           <li class=""><a href="#tab7" data-toggle="tab" class="analistic-01">Marek</a></li> 
           <li class=""><a href="#tab8" data-toggle="tab" class="analistic-02">Ozarks Bank</a></li> 
           <li class=""><a href="#tab9" data-toggle="tab" class="tehnical">CBRE </a></li> 
           <li class=""><a href="#tab10" data-toggle="tab" class="tehnical">Habitat</a></li> 
           <li class=""><a href="#tab11" data-toggle="tab" class="tehnical">Huffman</a></li> 
           <li class=""><a href="#tab12" data-toggle="tab" class="tehnical">Holiday</a></li> 
          </ul> 
         </div> 

         <div class="parrent media-body"> 
          <div class="tab-content"> 
           <div class="tab-pane fade" id="tab7"> 
            <div class="media"> 
             <div class="pull-left boxImg"> 
              <a href="Ref/Marek.pdf"><img class="img-responsive" src="images/Referals/MarekBrothers.jpg"></a> 
              <a href="Ref/Marek.pdf">Click for Referance</a> 
             </div> 
             <div class="media-body"> 
              <h2>Marek</h2> 
              <p>We recently built our new 50,000 SF headquarters building and used the Green-Zip Partition System everywhere. To me, it’s a simple solution and one that everyone should take advantage of! 
              <br> 
              -<b>R. Stan Marek</b>/Chairman 
              </p> 
             </div> 
            </div> 
           </div> 

           <div class="tab-pane fade" id="tab8"> 
            <div class="media"> 
             <div class="pull-left boxImg" style="margin-top: 20px;"> 
              <a href="Ref/Ozarks.pdf"><img class="img-responsive" src="images/Referals/BankOfTheOzarks.jpg" style="margin-top: 30px;"></a> 
              <a href="Ref/Ozarks.pdf">Click for Referance</a> 
             </div> 
             <div class="media-body"> 
              <h2>Bank Of The Ozarks</h2> 
              <p>….we now have a built in mechanism for remodeling that should be less expensive, less time consuming, and most importantly, environmentally friendly. <br> 
              -<b>Mark D. Ross</b>/Vice-Chairman & COO 
              </p> 
             </div> 
            </div> 
           </div> 

           <div class="tab-pane fade" id="tab9"> 
            <div class="media"> 
             <div class="pull-left boxImg"> 
              <a href="Ref/CBRE.pdf"><img class="img-responsive" src="images/Referals/CBRE.jpg"></a> 
              <a href="Ref/CBRE.pdf">Click for Referance</a> 
             </div> 
             <div class="media-body"> 
              <h2>CBRE</h2> 
              <p>….there is no reason not to consider Green Zip Tape as shorter-life property for any tax payer especially based on the design intent, which was originally based on the reusable concept. 
              <br> 
              -<b>Matt Rader</b>/National Managing Director 
              </p> 
             </div> 
            </div> 
           </div> 

           <div class="tab-pane fade" id="tab10"> 
            <div class="media"> 
             <div class="pull-left boxImg"> 
              <a href="Ref/Habitat.pdf"><img class="img-responsive" src="images/Referals/Habitat.jpg"></a> 
              <a href="Ref/Habitat.pdf">Click for Referance</a> 
             </div> 
             <div class="media-body"> 
              <h2>Habitat for Humanity</h2> 
              <p>I am very excited about the opportunity to help others have affordable and decent housing, while also keeping more products that can be reused from piling up in a local landfill. Now that is a winning combination! 
              <br> 
              -<b>Ron Collins</b>/Vice President of ReStores 
              </p> 
             </div> 
            </div> 
           </div> 

           <div class="tab-pane fade" id="tab11"> 
            <div class="media"> 
             <div class="pull-left boxImg"> 
              <a href="Ref/Huffman.pdf"><img class="img-responsive" src="images/Referals/Huffman.jpg"></a> 
              <a href="Ref/Huffman.pdf">Click for Referance</a> 
             </div> 
             <div class="media-body"> 
              <h2>Huffman Drywall</h2> 
              <p>In addition to the sustainable benefits, the financial benefits associated with accelerated depreciation are valuable to me as an owner, and could potentially add to the building’s value in the event of a sale. 
              <br> 
              -<b>Brandon Huffman</b>/President 
              </p> 
             </div> 
            </div> 
           </div> 

           <div class="tab-pane fade" id="tab12"> 
            <div class="media"> 
             <div class="pull-left boxImg"> 
              <a href="Ref/Holiday.pdf"><img class="img-responsive" src="images/Referals/Holiday.jpg"></a> 
              <a href="Ref/Holiday.pdf">Click for Referance</a> 
             </div> 
             <div class="media-body"> 
              <h2>Holiday Inn</h2> 
              <p>We found that the system will be acceptable for use in Holiday Inn, Holiday Inn Express hotels, and Staybridge Suites hotels. Congratulations. 
              <br> 
              -<b>Scott Bruce</b> 
              </p> 
             </div> 
            </div> 
           </div> 
          </div> 
          <!--/.tab-content--> 
         </div> 
         <!--/.media-body--> 
        </div> 
        <!--/.media--> 
       </div> 
       <!--/.tab-wrap--> 
      </div> 
      <!--/.col-sm-6--> 

ответ

1

Я не уверен, что вызывает изменение для вас, но если это «активный» класс, который применяется к <li> элемента, то это должно работать для вас :

JQuery:

var cycle = { 
    onReady: function() { 
    $(".nav-stacked li:first").addClass("active in"); 
    $("#tab1").addClass("active in"); 

    setInterval(function() { 
     var $navStacked = $("li.active"); 
     var tabContent = $("li.active a").attr("href"); 
     if ($navStacked.is(".nav-stacked li:last-child")) { 
     $navStacked.removeClass("active in"); 
     $(".nav-stacked li:first").addClass("active in"); 
     $("div " + tabContent).removeClass("active in"); 
     $("div#tab1").addClass("active in"); 
     } else { 
     $navStacked.removeClass("active in").next().addClass("active in"); 
     $("div " + tabContent).removeClass("active in").next().addClass("active in"); 
     } 
    }, 5000); 
    } 
}; 
$(document).ready(cycle.onReady); 

HTML:

<div class="media"> 
    <div class="parrent pull-left"> 
    <ul class="nav nav-tabs nav-stacked"> 
     <li class=""><a href="#tab1" data-toggle="tab" class="analistic-01">Architect</a></li> 
     <li class=""><a href="#tab2" data-toggle="tab" class="analistic-02">AIA</a></li> 
     <li class=""><a href="#tab3" data-toggle="tab" class="tehnical">IRS </a></li> 
     <li class=""><a href="#tab4" data-toggle="tab" class="tehnical">AKIN GUMP</a></li> 
     <li class=""><a href="#tab5" data-toggle="tab" class="tehnical">PWC</a></li> 
     <li class=""><a href="#tab6" data-toggle="tab" class="tehnical">EPA</a></li> 
    </ul> 
    </div> 

    <div class="parrent media-body"> 
    <div class="tab-content"> 
     <div class="tab-pane fade" id="tab1"> 
     <div class="media"> 
      <div class="pull-left boxImg"> 
      <a href="http://www.architectmagazine.com/awards/r-d-awards/award-green-zip-tape_o"><img class="img-responsive" src="images/Awards/R&D.png"></a> 
      </div> 
      <div class="media-body"> 
      <h2>Architect Magazine</h2> 
      <p>It’s hard to get simpler in conception and execution than Green-Zip Tape. The product is a substitute for the joint-compound tape that has been used between gypsum board panels since the introduction of prefabricated plasterboard in the early 
       1930s. The product impressed all three jurors.</p> 
      </div> 
     </div> 
     </div> 

     <div class="tab-pane fade" id="tab2"> 
     <div class="media"> 
      <div class="pull-left boxImg"> 
      <a href="http://info.aia.org/aiarchitect/thisweek07/1005/1005n_epa.htm"><img class="img-responsive" src="images/Awards/AIA.png"></a> 
      </div> 
      <div class="media-body"> 
      <h2>AIA Awards</h2> 
      <p>This patented demountable tape provides an alternative method for hanging sheetrock for future de-construction and reuse. 
      </p> 
      </div> 
     </div> 
     </div> 

     <div class="tab-pane fade" id="tab3"> 
     <div class="media"> 
      <div class="pull-left boxImg"> 
      <a href="https://www.irs.gov/pub/irs-wd/1404001.pdf"><img class="img-responsive" src="images/Awards/IRS.png"></a> 
      </div> 
      <div class="media-body"> 
      <h2>IRS Awards</h2> 
      <p>Taxpayer's Zip type partitions installed within the Owned Property and Leased Property are included in asset class 57.0 of Rev. Proc. 87-56 for purposes of § 168. 
      </p> 
      </div> 
     </div> 
     </div> 

     <div class="tab-pane fade" id="tab4"> 
     <div class="media"> 
      <div class="pull-left boxImg"> 
      <a href="https://www.akingump.com/en/news-insights/david-burton-examines-irs-private-letter-ruling-on-drywall.html"><img class="img-responsive" src="images/Awards/AkinGump.png"></a> 
      </div> 
      <div class="media-body"> 
      <h2>Akin Gump Awards</h2> 
      <p style="font-size: 12px;">The article analyzes an IRS ruling that says that zip system drywall is eligible for more favorable depreciation than conventional system drywall, despite the fact that each serves the same purpose and has a comparable cost. Burton also looks 
       at the opportunities this creates for real estate developers and the implications for certain nontraditional real estate investment trusts. 
      </p> 
      </div> 
     </div> 
     </div> 

     <div class="tab-pane fade" id="tab5"> 
     <div class="media"> 
      <div class="pull-left boxImg"> 
      <a href="http://www.pwc.com/us/en/tax-accounting-services/newsletters/accounting-methods/new-rulings-provide-guidance-tax-accounting-method-issues.html"><img class="img-responsive" src="images/Awards/PWC.png"></a> 
      </div> 
      <div class="media-body"> 
      <h2>PWC Awards</h2> 
      <p style="font-size: 12px;">IRS rules on the depreciation classification of certain interior, nonloadbearing partitions The IRS, in PLR 201404001, ruled that zip-type partitions installed within owned andleased property must be included in asset class 57.0 of Rev. Proc. 
       87-56 under Section 168, and that conventional drywall partitions are classified as non-residential real property under Section 168(e)(2)(B). 

      </p> 
      </div> 
     </div> 
     </div> 

     <div class="tab-pane fade" id="tab6"> 
     <div class="media"> 
      <div class="pull-left boxImg"> 
      <a href="http://www3.epa.gov/region9/waste/solid/construction/lifecyclebuilding/#win"><img class="img-responsive" src="images/Awards/US.png"></a> 
      </div> 
      <div class="media-body"> 
      <h2>EPA Awards</h2> 
      <p>Winner: Green-Zip-TapeTM Demountable Tape Drywall tape attachment system to support easy deconstruction and reuse 
      </p> 
      </div> 
     </div> 
     </div> 
    </div> 
    <!--/.tab-content--> 
    </div> 
    <!--/.media-body--> 
</div> 
<!--/.media--> 

CodePen

+0

Это сработало для реальных вкладок! однако это не изменило содержание вправо? – Charles

+0

Не могли бы вы разместить JavaScript и/или ссылку на плагин, который вы используете для управления вкладками? – medinasod

+0

его просто простая бутстрап. В JS вы предлагаете в основном подсвечивать вкладки активными, фактически не делая их «активными» – Charles