wp_enqueue_script('jquery-easing'); wp_enqueue_script('jquery-prettyPhoto'); wp_enqueue_script('jquery-tipsy'); wp_enqueue_script('jquery-tweetable'); wp_enqueue_script('jquery-nivo'); wp_enqueue_script('jquery-cycle'); wp_enqueue_script('jquery-jcarousel'); wp_enqueue_script('jquery-mobilemenu', get_template_directory_uri() . '/js/jquery.mobilemenu.js', array('jquery')); if (yiw_get_option('topbar_content') == 'twitter') { wp_enqueue_script('jquery-flexislider', get_template_directory_uri() . "/js/jquery.flexslider.min.js"); } if (yiw_get_option('popup')) { wp_enqueue_style('popup_css', get_template_directory_uri() . '/css/popup.css'); wp_enqueue_script('jquery-cookie', get_template_directory_uri() . '/js/jq-cookies.js', array('jquery')); } $slider_type = yiw_slider_type(); if (!in_array($slider_type, array('none', 'fixed-image'))) { if (!in_array($slider_type, array('carousel', 'flash'))) { wp_enqueue_style('slider-' . $slider_type, get_template_directory_uri() . "/css/slider-" . $slider_type . ".css"); } // cycle if ($slider_type == 'cycle') { wp_enqueue_script('swfobject'); } elseif ($slider_type == 'flash') { wp_enqueue_script('swfobject'); } elseif ($slider_type == 'thumbnails') { wp_enqueue_script('jquery-aw-showcases', get_template_directory_uri() . "/js/jquery.aw-showcase.js"); } elseif ($slider_type == 'unoslider') { $slider_theme = yiw_get_option('slider_' . $slider_type . '_theme'); wp_enqueue_style('slider-' . $slider_type . '-', get_template_directory_uri() . "/css/unoslider-themes/{$slider_theme}/theme.css"); wp_enqueue_script('unoslider', get_template_directory_uri() . "/js/unoslider.js");
/** * vars for elastic slider */ function yiw_slider_elastic_scripts() { if (yiw_slider_type() != 'elastic') { return; } ?> <script type="text/javascript"> var yiw_slider_type = 'elastic', yiw_slider_elastic_speed = <?php echo yiw_slide_get('speed') * 1000; ?> , yiw_slider_elastic_timeout = <?php echo yiw_slide_get('timeout') * 1000; ?> , yiw_slider_elastic_autoplay = <?php echo yiw_slide_get('autoplay') ? 'true' : 'false'; ?> , yiw_slider_elastic_animation = '<?php yiw_slide_the('animation'); ?> ';</script> <?php }
/** * Inizialize the slider. * * @since 1.0.0 */ function init() { // Retrieve the slider type $this->slider_type = yiw_slider_type(); // Retrieve all slides of the slider $this->slides = $this->get_slides(); // Retrieve number of elements of the slider $this->length = empty($this->slides) ? 0 : count($this->slides); }