row-js.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. if ( 'slideshow' == $settings->bg_type ) :
  3. $source = FLBuilderModel::get_row_slideshow_source( $row );
  4. if ( ! empty( $source ) ) :
  5. ?>
  6. YUI({'logExclude': { 'yui': true } }).use('fl-slideshow', function(Y) {
  7. if( null === Y.one('.fl-node-<?php echo $id; ?> .fl-bg-slideshow') ) {
  8. return;
  9. }
  10. var oldSlideshow = Y.one('.fl-node-<?php echo $id; ?> .fl-bg-slideshow .fl-slideshow'),
  11. newSlideshow = new Y.FL.Slideshow({
  12. autoPlay : true,
  13. crop : true,
  14. loadingImageEnabled : false,
  15. randomize : <?php echo $settings->ss_randomize; ?>,
  16. responsiveThreshold : 0,
  17. touchSupport : false,
  18. source : [{<?php echo $source; ?>}],
  19. speed : <?php echo $settings->ss_speed * 1000; ?>,
  20. stretchy : true,
  21. stretchyType : 'contain',
  22. transition : '<?php echo $settings->ss_transition; ?>',
  23. transitionDuration : <?php echo ! empty( $settings->ss_transitionDuration ) ? $settings->ss_transitionDuration : 1; // @codingStandardsIgnoreLine ?>
  24. });
  25. if(oldSlideshow) {
  26. oldSlideshow.remove(true);
  27. }
  28. jQuery( '.fl-node-<?php echo $id; ?>' ).imagesLoaded( function(){
  29. newSlideshow.render('.fl-node-<?php echo $id; ?> .fl-bg-slideshow');
  30. } );
  31. });
  32. <?php
  33. endif;
  34. endif;
  35. ?>