History
   Show Presentation
 
 
 -18
Home • Plugins • RWD_BS_Carousel • -18
 

<!--^ RWD/RWD_BS_Carousel/-18 T=<X-FC-REQUEST-TIME>--><!--#if expr="<X-FC-NUMITEMS Leaves>>0" If 0-->

</div>

<!-- Carousel indicators -->
<ul class="carousel-indicators">
<!--#rem set var="item_count" expr="++$item_count" -->
<!--#set var="INDEX" value="-1" -->
<!--#while expr="++$INDEX < $item_count" -->
           <li data-target="#rwd-carousel-<!--#echo var="cell_id" -->" data-slide-to="<!--#echo var="INDEX" -->"<!--#if expr="$INDEX == 0" --> class="active"<!--#endif -->><!--#echo expr="$INDEX + 1" --></li>
<!--#endwhile -->
</ul>

<!-- Controls -->
<a class="readmore rwdbs-modal" data-target="#rwdbsmodal" href="javascript:void(0);" data-rwd-iframe-src="$( this ).parent().find('.item.active').attr('href')">Read More</a>   

 <a class="left carousel-control" href="#rwd-carousel-<!--#echo var="cell_id" -->" data-slide="prev">
   <span class="glyphicon glyphicon-chevron-left"></span>
 </a>
 <a class="right carousel-control" href="#rwd-carousel-<!--#echo var="cell_id" -->" data-slide="next">
   <span class="glyphicon glyphicon-chevron-right"></span>
 </a>
</div>

<div class="modal fade" id="rwdbsmodal" tabindex="-1" role="dialog" aria-labelledby="custom_modal_label" aria-hidden="true">
   <div class="modal-dialog">
       <div class="modal-content">
           <div class="modal-body"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <div><iframe width="100%" height="350" src="" frameborder=0 border=0></iframe></div>
           </div>
       </div>
   </div>
</div>

<script>
$(function(){
$.when(<!--#echo expr="@substr($when_val, 1)" -->)
.always(function(){     
        $("#rwd-carousel-<!--#echo var="cell_id" -->").carousel({
                interval: 7000
        });
}); // .when always

<!--#if expr="$round_corner == 1" round corner-->
        $('.BS-carousel-Treatment1 .carousel-indicators').corner('bottom');
<!--#endif round corner-->


$('.video_mask').click(function(){
   iframe = $(this).closest('.item').find('iframe');
   if (iframe == null) return;
   iframe_source = iframe.attr('src');
   iframe_source = iframe_source + (iframe_source.indexOf('?')===-1?'?':'&') +"autoplay=1";
   iframe.attr('src', iframe_source);
   // hide the mask
   $(this).toggle();
   // stop the slideshow
   $('#rwd-carousel-<!--#echo var="cell_id" -->').carousel('pause');
 });

if ($( this ).find('.item.active').attr('rwd-data-itemcount') == '1' && $( this ).find('.item.active').attr('href') != '') {$('.rwdbs-modal').show();}

$('#rwd-carousel-<!--#echo var="cell_id" -->').on('slid.bs.carousel', function(){
        var openURL= $( this ).find('.item.active').attr('href');
        if (openURL == '') {$('.rwdbs-modal').hide();}
        else {$('.rwdbs-modal').show();}
})

$('#rwd-carousel-<!--#echo var="cell_id" -->').on('slide.bs.carousel', function(){

   var iframeID =$(this).find('iframe').attr("id");
   // stop iframe from playing
  /* if(iframeID != undefined){
     callPlayer(iframeID, 'stopVideo');
   } */
   // turn on all masks
   $('.video_mask').show();

   // reset src of all videos
   $('#rwd-carousel-<!--#echo var="cell_id" -->').find('iframe').each(function(key, value){
        url = $(this).attr('src');

         if(url.indexOf("&autoplay")>0){
            new_url = url.substring(0, url.indexOf("&autoplay"));
          }else if(url.indexOf("?autoplay")>0){
            new_url = url.substring(0, url.indexOf("?autoplay"));
          } else new_url = url;
          $(this).attr('src', new_url);
      });
   });

<!--  Readmore click -->
$(".rwdbs-modal").on( "click", function(e) {
                e.preventDefault();
                var theModal = $(this).data("target");
//                              theSRC = $( this ).parent().find('.item.active').attr('href');

                if ( $(this).attr("data-rwd-iframe-src") && $.trim($(this).attr("data-rwd-iframe-src")).length > 0){
                        var iframe_src = $.trim( $(this).attr("data-rwd-iframe-src") );
                        if (/^\$/.test(iframe_src)){ iframe_src = eval($(this).attr("data-rwd-iframe-src")); }else { iframe_src = $(this).attr("data-rwd-iframe-src"); };
                }

                $(theModal + ' iframe').attr('src', iframe_src);

                $(theModal).modal();

$(theModal+' button.close').click(function () {
                        $(theModal+' iframe').removeAttr('src');
                });
        }); /* $('.rwdbs-modal').on */

});
</script><noscript>Your browser does not support JavaScript!</noscript>
<!--#endif If 0-->