javascript - Bootstrap video tabs, load videos only when click tab -


i using bootstrap , have section on website using nav-tabs bootstrap, problem tabs contain videos. , have total of 14 video tabs. working, problem i'm dealing slow loading of website, , think might caused loading videos (even videos in hidden tab).

how possibly tell browser load video when tab .active?

my html (i display 3 tabs here, there total of 14):

<ul class="nav nav-tabs" id="videos">         <li class="active"><a data-toggle="tab" href="#one">1 &nbsp;<span class="glyphicon glyphicon-ok" style="color:green;"></span></a>         </li>         <li><a data-toggle="tab" href="#two">2 &nbsp;<span class="glyphicon glyphicon-ok" style="color:green;"></span></a>         </li>         <li><a data-toggle="tab" href="#three">3 &nbsp;<span class="glyphicon glyphicon-ok" style="color:green;"></span></a>         </li> </ul>      <div class="tab-content">                  <div id="one" class="tab-pane fade in active">                     <div class="col-lg-6 col-md-6 video-nr">                         <h3>video 1</h3>                     </div>                     <div class="col-lg-12 col-md-12 col-xs-12 col-xm-12">                         <div class="embed-responsive embed-responsive-16by9 video">                             <video controls>                                 <source src="video-1.mp4" type="video/mp4">                                 <source src="video-1.webm" type="video/webm">                                         browser not support video tag.                             </video>                         </div>                     </div>                 </div>                  <div id="two" class="tab-pane fade">                     <div class="col-lg-6 col-md-6 video-nr">                         <h3>video 2 </h3>                     </div>                     <div class="col-lg-12 col-md-12 col-xs-12 col-xm-12">                         <div class="embed-responsive embed-responsive-16by9 video">                              <video controls>                                 <source src="video-2.mp4" type="video/mp4">                                 <source src="video-2.webm" type="video/webm">                                         browser not support video tag.                             </video>                         </div>                     </div>                 </div>                  <div id="three" class="tab-pane fade">                     <div class="col-lg-6 col-md-6 video-nr">                         <h3>video 3</h3>                     </div>                     <div class="col-lg-12 col-md-12 col-xs-12 col-xm-12">                         <div class="embed-responsive embed-responsive-16by9 video">                                               <video controls>                                 <source src="video-3.mp4" type="video/mp4">                                 <source src="video-3.webm" type="video/webm">                                         browser not support video tag.                             </video>                         </div>                     </div>                   </div>     </div> 


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -