frontend.js.php 1.3 KB
<?php 
	
	// set defaults
	$autoplay = !empty( $settings->speed ) ? $settings->speed * 1000 : '1000';
	$speed = !empty( $settings->transitionDuration ) ? $settings->transitionDuration * 1000 : '1000';

 ?>

(function($) {

	$(function() {
	
	    new FLBuilderPostSlider({
	    	id: '<?php echo $id ?>',
        <?php if( isset( $settings->navigation ) && $settings->navigation == 'yes' ): ?>
			navigationControls: true,
	    <?php endif; ?>
	    	settings: {
	        <?php if( isset( $settings->transition ) ): ?>
		        mode: '<?php echo $settings->transition ?>',
		    <?php endif; ?>
	        <?php if( isset( $settings->pagination ) && $settings->pagination == 'no' ): ?>
		        pager: false,
		    <?php endif; ?>
	        <?php if( isset( $settings->auto_play ) ): ?>
		        auto: <?php echo $settings->auto_play ?>,
		    <?php else : ?>
		    	auto: false,
		    <?php endif; ?>
		        pause: <?php echo $autoplay ?>,
		        speed: <?php echo $speed ?>,
	        <?php if( isset( $settings->slider_loop ) ): ?>
		        infiniteLoop: <?php echo $settings->slider_loop ?>,
		    <?php else : ?>
		        infiniteLoop: false,
		    <?php endif; ?>
		    	adaptiveHeight: true,
		    	controls: false,
		    	autoHover: true,
	    	}
	    });

	});

})(jQuery);