Version Description
Upgrade the plugin to get more features and better performance.
Download this release
Release Info
Developer | sayful |
Plugin | Carousel Slider |
Version | 1.1 |
Comparing to | |
See all releases |
Version 1.1
- carousel-img-type.php +85 -0
- carousel-options.php +209 -0
- carousel.php +224 -0
- css/owl.carousel.css +70 -0
- css/owl.theme.css +89 -0
- css/owl.transitions.css +163 -0
- js/carousel-button.js +25 -0
- js/carousel-color-script.js +6 -0
- js/carousel.png +0 -0
- js/owl.carousel.js +1512 -0
- readme.txt +105 -0
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
- screenshot-4.png +0 -0
- uninstall.php +12 -0
carousel-img-type.php
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Register Custom Post Type
|
3 |
+
function sis_carousel_custom_post_type() {
|
4 |
+
|
5 |
+
$labels = array(
|
6 |
+
'name' => _x( 'Carousels', 'Post Type General Name', 'carousel' ),
|
7 |
+
'singular_name' => _x( 'Carousel', 'Post Type Singular Name', 'carousel' ),
|
8 |
+
'menu_name' => __( 'Carousels', 'carousel' ),
|
9 |
+
'parent_item_colon' => __( 'Parent Carousel:', 'carousel' ),
|
10 |
+
'all_items' => __( 'All Carousels', 'carousel' ),
|
11 |
+
'view_item' => __( 'View Carousel', 'carousel' ),
|
12 |
+
'add_new_item' => __( 'Add New Carousel', 'carousel' ),
|
13 |
+
'add_new' => __( 'Add New', 'carousel' ),
|
14 |
+
'edit_item' => __( 'Edit Carousel', 'carousel' ),
|
15 |
+
'update_item' => __( 'Update Carousel', 'carousel' ),
|
16 |
+
'search_items' => __( 'Search Carousel', 'carousel' ),
|
17 |
+
'not_found' => __( 'Not found', 'carousel' ),
|
18 |
+
'not_found_in_trash' => __( 'Not found in Trash', 'carousel' ),
|
19 |
+
);
|
20 |
+
$rewrite = array(
|
21 |
+
'slug' => 'carousel',
|
22 |
+
'with_front' => true,
|
23 |
+
'pages' => true,
|
24 |
+
'feeds' => true,
|
25 |
+
);
|
26 |
+
$args = array(
|
27 |
+
'label' => __( 'carousel', 'carousel' ),
|
28 |
+
'description' => __( 'Post Type Description', 'carousel' ),
|
29 |
+
'labels' => $labels,
|
30 |
+
'supports' => array( 'title', 'thumbnail', ),
|
31 |
+
'taxonomies' => array( 'category', 'post_tag' ),
|
32 |
+
'hierarchical' => false,
|
33 |
+
'public' => true,
|
34 |
+
'show_ui' => true,
|
35 |
+
'show_in_menu' => true,
|
36 |
+
'show_in_nav_menus' => true,
|
37 |
+
'show_in_admin_bar' => true,
|
38 |
+
'menu_position' => 5,
|
39 |
+
'menu_icon' => 'dashicons-slides',
|
40 |
+
'can_export' => true,
|
41 |
+
'has_archive' => true,
|
42 |
+
'exclude_from_search' => false,
|
43 |
+
'publicly_queryable' => true,
|
44 |
+
'rewrite' => $rewrite,
|
45 |
+
'capability_type' => 'page',
|
46 |
+
);
|
47 |
+
register_post_type( 'carousel', $args );
|
48 |
+
|
49 |
+
}
|
50 |
+
|
51 |
+
// Hook into the 'init' action
|
52 |
+
add_action( 'init', 'sis_carousel_custom_post_type', 0 );
|
53 |
+
|
54 |
+
/* Move featured image box under title */
|
55 |
+
function sis_carousel_img_box()
|
56 |
+
{
|
57 |
+
remove_meta_box( 'postimagediv', 'carousel', 'side' );
|
58 |
+
add_meta_box('postimagediv', __('Upload Carousel Image'), 'post_thumbnail_meta_box', 'carousel', 'normal', 'high');
|
59 |
+
}
|
60 |
+
add_action('do_meta_boxes', 'sis_carousel_img_box');
|
61 |
+
|
62 |
+
/*Shortcode for carousel by custom button*/
|
63 |
+
function sis_get_carousel(){
|
64 |
+
$siscarousel= '<div id="owl-carousel" class="owl-carousel">';
|
65 |
+
$carousel_query= "post_type=carousel&posts_per_page=-1";
|
66 |
+
query_posts($carousel_query);
|
67 |
+
if (have_posts()) : while (have_posts()) : the_post();
|
68 |
+
$img= get_the_post_thumbnail( $post->ID, 'large' );
|
69 |
+
$siscarousel.='<div class="carousel_img">'.$img.'</div>';
|
70 |
+
endwhile; endif; wp_reset_query();
|
71 |
+
$siscarousel.= '</div>';
|
72 |
+
return $siscarousel;
|
73 |
+
}
|
74 |
+
|
75 |
+
/**add the shortcode for the slider- for use in editor**/
|
76 |
+
function sis_insert_carousel($atts, $content=null){
|
77 |
+
$siscarousel= sis_get_carousel();
|
78 |
+
return $siscarousel;
|
79 |
+
}
|
80 |
+
add_shortcode('all-carousels', 'sis_insert_carousel');
|
81 |
+
|
82 |
+
/**add template tag- for use in themes**/
|
83 |
+
function sis_carousel_for_theme(){
|
84 |
+
print sis_get_carousel();
|
85 |
+
}
|
carousel-options.php
ADDED
@@ -0,0 +1,209 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div id="wpbody">
|
2 |
+
<div class="wrap">
|
3 |
+
<h2>Carousel Settings</h2>
|
4 |
+
<form action="options.php" method="post">
|
5 |
+
<?php
|
6 |
+
settings_fields( 'sis_carousel_settings' );
|
7 |
+
$options = get_option( 'sis_carousel_settings' );
|
8 |
+
?>
|
9 |
+
<table class="form-table">
|
10 |
+
<tbody>
|
11 |
+
<tr valign="top">
|
12 |
+
<th scope="row">
|
13 |
+
<label for="sis_carousel_settings[max_items]">Maximum Items</label>
|
14 |
+
</th>
|
15 |
+
<td>
|
16 |
+
<input type="number" min="1" max="10" name="sis_carousel_settings[max_items]" id="" value="<?php esc_attr_e($options['max_items']); ?>">
|
17 |
+
<p class="description">This variable allows you to set the maximum amount of items displayed at a time with the widest browser width (window >= 1200)</p>
|
18 |
+
</td>
|
19 |
+
</tr>
|
20 |
+
<tr valign="top">
|
21 |
+
<th scope="row">
|
22 |
+
<label for="">Items Desktop</label>
|
23 |
+
</th>
|
24 |
+
<td>
|
25 |
+
<input type="number" min="1" max="10" name="sis_carousel_settings[items_desktop]" id="" value="<?php esc_attr_e($options['items_desktop']); ?>">
|
26 |
+
<p class="description">This allows you to preset the number of slides visible with (window <= 1199) browser width</p>
|
27 |
+
</td>
|
28 |
+
</tr>
|
29 |
+
<tr valign="top">
|
30 |
+
<th scope="row">
|
31 |
+
<label for="">Items Desktop Small</label>
|
32 |
+
</th>
|
33 |
+
<td>
|
34 |
+
<input type="number" min="1" max="10" name="sis_carousel_settings[items_desktop_small]" id="" value="<?php esc_attr_e($options['items_desktop_small']); ?>">
|
35 |
+
<p class="description">This allows you to preset the number of slides visible with (window <= 979) browser width</p>
|
36 |
+
</td>
|
37 |
+
</tr>
|
38 |
+
<tr valign="top">
|
39 |
+
<th scope="row">
|
40 |
+
<label for="">Items Tablet</label>
|
41 |
+
</th>
|
42 |
+
<td>
|
43 |
+
<input type="number" min="1" max="10" name="sis_carousel_settings[items_tablet]" id="" value="<?php esc_attr_e($options['items_tablet']); ?>">
|
44 |
+
<p class="description">This allows you to preset the number of slides visible with (window <= 768) browser width</p>
|
45 |
+
</td>
|
46 |
+
</tr>
|
47 |
+
<tr valign="top">
|
48 |
+
<th scope="row">
|
49 |
+
<label for="">Items Mobile</label>
|
50 |
+
</th>
|
51 |
+
<td>
|
52 |
+
<input type="number" min="1" max="10" name="sis_carousel_settings[items_mobile]" id="" value="<?php esc_attr_e($options['items_mobile']); ?>">
|
53 |
+
<p class="description">This allows you to preset the number of slides visible with (window <= 479) browser width</p>
|
54 |
+
</td>
|
55 |
+
</tr>
|
56 |
+
<tr valign="top">
|
57 |
+
<th scope="row">
|
58 |
+
<label for="sis_carousel_settings[items_single]">Single Item</label>
|
59 |
+
</th>
|
60 |
+
<td>
|
61 |
+
<input type='radio' name='sis_carousel_settings[items_single]' value='false' <?php if ( 'false' == $options['items_single'] ) echo 'checked="checked"'; ?> /> NO
|
62 |
+
<input type='radio' name='sis_carousel_settings[items_single]' value='true' <?php if ( 'true' == $options['items_single'] ) echo 'checked="checked"'; ?> /> Yes
|
63 |
+
<p class="description">If you select 'Yes', it will display only one item and top five options will be automatically stopped.</p>
|
64 |
+
</td>
|
65 |
+
</tr>
|
66 |
+
<tr valign="top">
|
67 |
+
<th scope="row">
|
68 |
+
<label for="sis_carousel_settings[transitionstyle]">Transition Style</label>
|
69 |
+
</th>
|
70 |
+
<td>
|
71 |
+
<select name="sis_carousel_settings[transitionstyle]">
|
72 |
+
<option value="fade" <?php selected( $options['transitionstyle'], 'fade' ); ?>>fade</option>
|
73 |
+
<option value="backSlide" <?php selected( $options['transitionstyle'], 'backSlide' ); ?>>backSlide</option>
|
74 |
+
<option value="goDown" <?php selected( $options['transitionstyle'], 'goDown' ); ?>>goDown</option>
|
75 |
+
<option value="scaleUp" <?php selected( $options['transitionstyle'], 'scaleUp' ); ?>>scaleUp</option>
|
76 |
+
</select>
|
77 |
+
<p class="description">Transition style works only in modern browsers that support CSS3 translate3d methods and only with single item on screen.</p>
|
78 |
+
</td>
|
79 |
+
</tr>
|
80 |
+
<tr valign="top">
|
81 |
+
<th scope="row">
|
82 |
+
<label for="">Slide Speed</label>
|
83 |
+
</th>
|
84 |
+
<td>
|
85 |
+
<input type="number" name="sis_carousel_settings[slide_speed]" id="" value="<?php esc_attr_e($options['slide_speed']); ?>">
|
86 |
+
<p class="description">Slide speed in milliseconds. Default speed is '200' milliseconds.</p>
|
87 |
+
</td>
|
88 |
+
</tr>
|
89 |
+
<tr valign="top">
|
90 |
+
<th scope="row">
|
91 |
+
<label for="">Pagination Speed</label>
|
92 |
+
</th>
|
93 |
+
<td>
|
94 |
+
<input type="number" name="sis_carousel_settings[pagination_speed]" id="" value="<?php esc_attr_e($options['pagination_speed']); ?>">
|
95 |
+
<p class="description">Pagination speed in milliseconds. Default speed is '800' milliseconds.</p>
|
96 |
+
</td>
|
97 |
+
</tr>
|
98 |
+
<tr valign="top">
|
99 |
+
<th scope="row">
|
100 |
+
<label for="">Rewind Speed</label>
|
101 |
+
</th>
|
102 |
+
<td>
|
103 |
+
<input type="number" name="sis_carousel_settings[rewind_speed]" id="" value="<?php esc_attr_e($options['rewind_speed']); ?>">
|
104 |
+
<p class="description">Rewind speed in milliseconds. Default speed is '1000' milliseconds.</p>
|
105 |
+
</td>
|
106 |
+
</tr>
|
107 |
+
<tr valign="top">
|
108 |
+
<th scope="row">
|
109 |
+
<label for="sis_carousel_autoplay">AutoPlay</label>
|
110 |
+
</th>
|
111 |
+
<td>
|
112 |
+
<input type="text" name="sis_carousel_settings[autoplay]" id="" value="<?php esc_attr_e($options['autoplay']); ?>">
|
113 |
+
<p class="description">Change to any integrer for example 'autoPlay : 5000' to play every 5 seconds. If you set 'autoPlay: true' default speed will be 5 seconds.</p>
|
114 |
+
</td>
|
115 |
+
</tr>
|
116 |
+
<tr valign="top">
|
117 |
+
<th scope="row">
|
118 |
+
<label for="">Stop On Hover</label>
|
119 |
+
</th>
|
120 |
+
<td>
|
121 |
+
<input type='radio' name='sis_carousel_settings[stoponhover]' value='false' <?php if ( 'false' == $options['stoponhover'] ) echo 'checked="checked"'; ?> /> NO
|
122 |
+
<input type='radio' name='sis_carousel_settings[stoponhover]' value='true' <?php if ( 'true' == $options['stoponhover'] ) echo 'checked="checked"'; ?> /> Yes
|
123 |
+
<p class="description">Stop autoplay on mouse hover.</p>
|
124 |
+
</td>
|
125 |
+
</tr>
|
126 |
+
<tr valign="top">
|
127 |
+
<th scope="row">
|
128 |
+
<label for="">Navigation</label>
|
129 |
+
</th>
|
130 |
+
<td>
|
131 |
+
<input type='radio' name='sis_carousel_settings[navigation]' value='false' <?php if ( 'false' == $options['navigation'] ) echo 'checked="checked"'; ?> /> NO
|
132 |
+
<input type='radio' name='sis_carousel_settings[navigation]' value='true' <?php if ( 'true' == $options['navigation'] ) echo 'checked="checked"'; ?> /> Yes
|
133 |
+
<p class="description">Display "next" and "prev" buttons.</p>
|
134 |
+
</td>
|
135 |
+
</tr>
|
136 |
+
<tr valign="top">
|
137 |
+
<th scope="row">
|
138 |
+
<label for="sis_carousel_settings[navigation_bg_color]">Navigation Color</label>
|
139 |
+
</th>
|
140 |
+
<td>
|
141 |
+
<input type="text" name="sis_carousel_settings[navigation_bg_color]" id="navigation_bg_color" value="<?php esc_attr_e($options['navigation_bg_color']); ?>">
|
142 |
+
<p class="description">Choose color for Navigation Background.</p>
|
143 |
+
</td>
|
144 |
+
</tr>
|
145 |
+
<tr valign="top">
|
146 |
+
<th scope="row">
|
147 |
+
<label for="sis_carousel_settings[navigation_arrow_color]">Navigation Arrow Color</label>
|
148 |
+
</th>
|
149 |
+
<td>
|
150 |
+
<input type="text" name="sis_carousel_settings[navigation_arrow_color]" id="navigation_arrow_color" value="<?php esc_attr_e($options['navigation_arrow_color']); ?>">
|
151 |
+
<p class="description">Choose color for Navigation Arrow.</p>
|
152 |
+
</td>
|
153 |
+
</tr>
|
154 |
+
<tr valign="top">
|
155 |
+
<th scope="row">
|
156 |
+
<label for="">Scroll Per Page</label>
|
157 |
+
</th>
|
158 |
+
<td>
|
159 |
+
<input type='radio' name='sis_carousel_settings[scrollperpage]' value='false' <?php if ( 'false' == $options['scrollperpage'] ) echo 'checked="checked"'; ?> /> NO
|
160 |
+
<input type='radio' name='sis_carousel_settings[scrollperpage]' value='true' <?php if ( 'true' == $options['scrollperpage'] ) echo 'checked="checked"'; ?> /> Yes
|
161 |
+
<p class="description">Scroll per page not per item. This affect next/prev buttons and mouse/touch dragging.</p>
|
162 |
+
</td>
|
163 |
+
</tr>
|
164 |
+
<tr valign="top">
|
165 |
+
<th scope="row">
|
166 |
+
<label for="">Pagination</label>
|
167 |
+
</th>
|
168 |
+
<td>
|
169 |
+
<input type='radio' name='sis_carousel_settings[pagination]' value='false' <?php if ( 'false' == $options['pagination'] ) echo 'checked="checked"'; ?> /> NO
|
170 |
+
<input type='radio' name='sis_carousel_settings[pagination]' value='true' <?php if ( 'true' == $options['pagination'] ) echo 'checked="checked"'; ?> /> Yes
|
171 |
+
<p class="description">Show pagination.</p>
|
172 |
+
</td>
|
173 |
+
</tr>
|
174 |
+
<tr valign="top">
|
175 |
+
<th scope="row">
|
176 |
+
<label for="">Pagination Color</label>
|
177 |
+
</th>
|
178 |
+
<td>
|
179 |
+
<input type="text" name="sis_carousel_settings[pagination_bg_color]" id="pagination_bg_color" value="<?php esc_attr_e($options['pagination_bg_color']); ?>">
|
180 |
+
<p class="description">Choose color for Pagination Background.</p>
|
181 |
+
</td>
|
182 |
+
</tr>
|
183 |
+
<tr valign="top">
|
184 |
+
<th scope="row">
|
185 |
+
<label for="">Pagination Numbers</label>
|
186 |
+
</th>
|
187 |
+
<td>
|
188 |
+
<input type='radio' name='sis_carousel_settings[paginationnumbers]' value='false' <?php if ( 'false' == $options['paginationnumbers'] ) echo 'checked="checked"'; ?> /> NO
|
189 |
+
<input type='radio' name='sis_carousel_settings[paginationnumbers]' value='true' <?php if ( 'true' == $options['paginationnumbers'] ) echo 'checked="checked"'; ?> /> Yes
|
190 |
+
<p class="description">Show numbers inside pagination buttons</p>
|
191 |
+
</td>
|
192 |
+
</tr>
|
193 |
+
<tr valign="top">
|
194 |
+
<th scope="row">
|
195 |
+
<label for="">Pagination Number Color</label>
|
196 |
+
</th>
|
197 |
+
<td>
|
198 |
+
<input type="text" name="sis_carousel_settings[pagination_num_color]" id="pagination_num_color" value="<?php esc_attr_e($options['pagination_num_color']); ?>">
|
199 |
+
<p class="description">Choose color for Pagination Number.</p>
|
200 |
+
</td>
|
201 |
+
</tr>
|
202 |
+
</tbody>
|
203 |
+
</table>
|
204 |
+
<p class="submit"><input type="submit" value="<?php _e('Save Changes') ?>" class="button button-primary" id="submit" name="submit"></p>
|
205 |
+
</form>
|
206 |
+
</div>
|
207 |
+
<div class="clear"></div>
|
208 |
+
</div>
|
209 |
+
<div class="clear"></div>
|
carousel.php
ADDED
@@ -0,0 +1,224 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: Carousel Slider
|
4 |
+
Plugin URI: http://wordpress.org/plugins/carousel-slider
|
5 |
+
Description: Touch enabled wordpress plugin that lets you create beautiful responsive carousel slider.
|
6 |
+
Version: 1.1
|
7 |
+
Author: Sayful Islam
|
8 |
+
Author URI: http://sayful.net
|
9 |
+
License: GPLv2 or later
|
10 |
+
*/
|
11 |
+
|
12 |
+
// Set up our WordPress Plugin
|
13 |
+
function sis_carousel_check_WP_ver()
|
14 |
+
{
|
15 |
+
$options_array = array(
|
16 |
+
// Most important owl features
|
17 |
+
'max_items' => '5',
|
18 |
+
'items_desktop' => '4',
|
19 |
+
'items_desktop_small' => '3',
|
20 |
+
'items_tablet' => '2',
|
21 |
+
'items_mobile' => '1',
|
22 |
+
'items_single' => 'false',
|
23 |
+
//Basic Speeds
|
24 |
+
'slide_speed' => '200',
|
25 |
+
'pagination_speed' => '800',
|
26 |
+
'rewind_speed' => '1000',
|
27 |
+
//Autoplay
|
28 |
+
'autoplay' => 'true',
|
29 |
+
'stoponhover' => 'true',
|
30 |
+
//Navigation
|
31 |
+
'navigation' => 'false',
|
32 |
+
'navigation_bg_color' => '#869791',
|
33 |
+
'navigation_arrow_color' => '#ffffff',
|
34 |
+
'scrollperpage' => 'false',
|
35 |
+
//Pagination
|
36 |
+
'pagination' => 'false',
|
37 |
+
'pagination_bg_color' => '#869791',
|
38 |
+
'paginationnumbers' => 'false',
|
39 |
+
'pagination_num_color' => '#ffffff',
|
40 |
+
//Transitions
|
41 |
+
'transitionstyle' => 'fade',
|
42 |
+
);
|
43 |
+
if ( get_option( 'sis_carousel_settings' ) !== false ) {
|
44 |
+
// The option already exists, so we just update it.
|
45 |
+
update_option( 'sis_carousel_settings', $options_array );
|
46 |
+
} else{
|
47 |
+
// The option hasn't been added yet. We'll add it with $autoload set to 'no'.
|
48 |
+
add_option( 'sis_carousel_settings', $options_array );
|
49 |
+
}
|
50 |
+
}
|
51 |
+
register_activation_hook( __FILE__, 'sis_carousel_check_WP_ver' );
|
52 |
+
|
53 |
+
//register settings
|
54 |
+
function sis_carousel_settings_init(){
|
55 |
+
register_setting( 'sis_carousel_settings', 'sis_carousel_settings' );
|
56 |
+
}
|
57 |
+
add_action( 'admin_init', 'sis_carousel_settings_init' );
|
58 |
+
|
59 |
+
/* Adding coolor picker from Wordpress admin page */
|
60 |
+
function sis_carousel_color_picker( $hook_suffix ) {
|
61 |
+
// first check that $hook_suffix is appropriate for your admin page
|
62 |
+
wp_enqueue_style( 'wp-color-picker' );
|
63 |
+
wp_enqueue_script( 'sis-carousel-color-handle', plugins_url('/js/carousel-color-script.js', __FILE__ ), array( 'wp-color-picker' ), false, true );
|
64 |
+
}
|
65 |
+
add_action( 'admin_enqueue_scripts', 'sis_carousel_color_picker' );
|
66 |
+
|
67 |
+
/* Adding Latest jQuery from Wordpress */
|
68 |
+
function sis_carousel_plugin_scripts() {
|
69 |
+
wp_enqueue_script('jquery');
|
70 |
+
wp_enqueue_script('sis_carousel_main_script',plugins_url( '/js/owl.carousel.js' , __FILE__ ),array( 'jquery' ));
|
71 |
+
|
72 |
+
wp_enqueue_style('sis_carousel_main_style',plugins_url( '/css/owl.carousel.css' , __FILE__ ));
|
73 |
+
wp_enqueue_style('sis_carousel_theme_style',plugins_url( '/css/owl.theme.css' , __FILE__ ));
|
74 |
+
wp_enqueue_style('sis_carousel_transitions_style',plugins_url( '/css/owl.transitions.css' , __FILE__ ));
|
75 |
+
}
|
76 |
+
add_action('init', 'sis_carousel_plugin_scripts');
|
77 |
+
|
78 |
+
/*Plugin options page */
|
79 |
+
|
80 |
+
function sis_carousel_custom_menu_page(){
|
81 |
+
add_options_page( 'Carousel Settings', 'Carousels', 'manage_options', 'carousel-slider/carousel-options.php');
|
82 |
+
}
|
83 |
+
add_action( 'admin_menu', 'sis_carousel_custom_menu_page' );
|
84 |
+
|
85 |
+
|
86 |
+
/* Carousel activation hook*/
|
87 |
+
function sis_carousel_activation_hook(){
|
88 |
+
$options = get_option( 'sis_carousel_settings' );
|
89 |
+
?><script type="text/javascript">
|
90 |
+
jQuery(document).ready(function() {
|
91 |
+
jQuery("#owl-carousel").owlCarousel({
|
92 |
+
|
93 |
+
// Most important owl features
|
94 |
+
items : <?php echo $options['max_items']; ?>,
|
95 |
+
itemsDesktop : [1199,<?php echo $options['items_desktop']; ?>],
|
96 |
+
itemsDesktopSmall : [980,<?php echo $options['items_desktop_small']; ?>],
|
97 |
+
itemsTablet: [768,<?php echo $options['items_tablet']; ?>],
|
98 |
+
itemsMobile : [479,<?php echo $options['items_mobile']; ?>],
|
99 |
+
singleItem : <?php echo $options['items_single']; ?>,
|
100 |
+
|
101 |
+
//Basic Speeds
|
102 |
+
slideSpeed : <?php echo $options['slide_speed']; ?>,
|
103 |
+
paginationSpeed : <?php echo $options['pagination_speed']; ?>,
|
104 |
+
rewindSpeed : <?php echo $options['rewind_speed']; ?>,
|
105 |
+
|
106 |
+
//Autoplay
|
107 |
+
autoPlay : <?php echo $options['autoplay']; ?>,
|
108 |
+
stopOnHover : <?php echo $options['stoponhover']; ?>,
|
109 |
+
|
110 |
+
// Navigation
|
111 |
+
navigation : <?php echo $options['navigation']; ?>,
|
112 |
+
navigationText : ["<",">"],
|
113 |
+
rewindNav : true,
|
114 |
+
scrollPerPage : <?php echo $options['scrollperpage']; ?>,
|
115 |
+
|
116 |
+
//Pagination
|
117 |
+
pagination : <?php echo $options['pagination']; ?>,
|
118 |
+
paginationNumbers: <?php echo $options['paginationnumbers']; ?>,
|
119 |
+
|
120 |
+
//Transitions
|
121 |
+
transitionStyle : '<?php echo $options['transitionstyle']; ?>',
|
122 |
+
});
|
123 |
+
});
|
124 |
+
</script>
|
125 |
+
<?php }
|
126 |
+
add_action('wp_footer','sis_carousel_activation_hook');
|
127 |
+
|
128 |
+
function sis_carousel_custom_inline_style(){
|
129 |
+
$options = get_option( 'sis_carousel_settings' );
|
130 |
+
?><style>
|
131 |
+
/* Navigation */
|
132 |
+
.owl-theme .owl-controls .owl-buttons div{
|
133 |
+
color: <?php echo $options['navigation_arrow_color']; ?>;
|
134 |
+
background: <?php echo $options['navigation_bg_color']; ?>;
|
135 |
+
}
|
136 |
+
/* Styling Pagination*/
|
137 |
+
.owl-theme .owl-controls .owl-page span{
|
138 |
+
background: <?php echo $options['pagination_bg_color']; ?>;
|
139 |
+
}
|
140 |
+
.owl-theme .owl-controls .owl-page span.owl-numbers{
|
141 |
+
color: <?php echo $options['pagination_num_color']; ?>;
|
142 |
+
}
|
143 |
+
</style><?php
|
144 |
+
}
|
145 |
+
add_action('wp_head','sis_carousel_custom_inline_style');
|
146 |
+
|
147 |
+
/*Shortcode for carousel by custom button*/
|
148 |
+
function sis_carousel_wrapper_shortcode( $atts, $content = null ) {
|
149 |
+
extract(shortcode_atts(array(
|
150 |
+
'id' =>'carouselsc',
|
151 |
+
'items' =>'4',
|
152 |
+
'itemsDesktop' =>'4',
|
153 |
+
'itemsDesktopSmall' =>'4',
|
154 |
+
'itemsTablet' =>'3',
|
155 |
+
'itemsMobile' =>'2',
|
156 |
+
'singleItem' =>'false',
|
157 |
+
'slideSpeed' =>'200',
|
158 |
+
'paginationSpeed' =>'800',
|
159 |
+
'rewindSpeed' =>'1000',
|
160 |
+
'autoPlay' =>'true',
|
161 |
+
'stopOnHover' =>'true',
|
162 |
+
'navigation' =>'false',
|
163 |
+
'scrollPerPage' =>'false',
|
164 |
+
'pagination' =>'false',
|
165 |
+
'paginationNumbers' =>'false',
|
166 |
+
'transitionStyle' =>'fade',
|
167 |
+
), $atts));
|
168 |
+
return '<div id="'.$id.'" class="owl-carousel">'.do_shortcode($content).'</div>
|
169 |
+
<script type="text/javascript">
|
170 |
+
jQuery(document).ready(function() {
|
171 |
+
jQuery("#'.$id.'").owlCarousel({
|
172 |
+
items : '.$items.',
|
173 |
+
itemsDesktop : [1199,'.$itemsDesktop.'],
|
174 |
+
itemsDesktopSmall : [980,'.$itemsDesktopSmall.'],
|
175 |
+
itemsTablet: [768,'.$itemsTablet.'],
|
176 |
+
itemsMobile : [479,'.$itemsMobile.'],
|
177 |
+
singleItem : '.$singleItem.',
|
178 |
+
slideSpeed : '.$slideSpeed.',
|
179 |
+
paginationSpeed : '.$paginationSpeed.',
|
180 |
+
rewindSpeed : '.$rewindSpeed.',
|
181 |
+
autoPlay : '.$autoPlay.',
|
182 |
+
stopOnHover : '.$stopOnHover.',
|
183 |
+
navigation : '.$navigation.',
|
184 |
+
navigationText : ["<",">"],
|
185 |
+
rewindNav : true,
|
186 |
+
scrollPerPage : '.$scrollPerPage.',
|
187 |
+
pagination : '.$pagination.',
|
188 |
+
paginationNumbers: '.$paginationNumbers.',
|
189 |
+
transitionStyle : "'.$transitionStyle.'",
|
190 |
+
});
|
191 |
+
});
|
192 |
+
</script>';
|
193 |
+
}
|
194 |
+
add_shortcode( 'carousel', 'sis_carousel_wrapper_shortcode' );
|
195 |
+
|
196 |
+
function sis_carousel_shortcode( $atts, $content = null ) {
|
197 |
+
extract(shortcode_atts(array(
|
198 |
+
'img_link' =>'',
|
199 |
+
), $atts));
|
200 |
+
return '<div class=""><img src="'.$img_link.'"></div>';
|
201 |
+
}
|
202 |
+
add_shortcode( 'item', 'sis_carousel_shortcode' );
|
203 |
+
|
204 |
+
/* Add Accordion Shortcode Button on Post Visual Editor */
|
205 |
+
|
206 |
+
function siscarousel_button() {
|
207 |
+
add_filter ("mce_external_plugins", "siscarousel_button_js");
|
208 |
+
add_filter ("mce_buttons", "siscarouselb");
|
209 |
+
}
|
210 |
+
|
211 |
+
function siscarousel_button_js($plugin_array) {
|
212 |
+
$plugin_array['siscours'] = plugins_url('js/carousel-button.js', __FILE__);
|
213 |
+
return $plugin_array;
|
214 |
+
}
|
215 |
+
|
216 |
+
function siscarouselb($buttons) {
|
217 |
+
array_push ($buttons, 'siscarouseltriger');
|
218 |
+
return $buttons;
|
219 |
+
}
|
220 |
+
add_action ('init', 'siscarousel_button');
|
221 |
+
|
222 |
+
|
223 |
+
/*Files to Include */
|
224 |
+
require_once('carousel-img-type.php');
|
css/owl.carousel.css
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* Core Owl Carousel CSS File
|
3 |
+
* v1.3.2
|
4 |
+
*/
|
5 |
+
/* clearfix */
|
6 |
+
.owl-carousel .owl-wrapper:after {
|
7 |
+
content: ".";
|
8 |
+
display: block;
|
9 |
+
clear: both;
|
10 |
+
visibility: hidden;
|
11 |
+
line-height: 0;
|
12 |
+
height: 0;
|
13 |
+
}
|
14 |
+
/* display none until init */
|
15 |
+
.owl-carousel{
|
16 |
+
display: none;
|
17 |
+
position: relative;
|
18 |
+
width: 100%;
|
19 |
+
-ms-touch-action: pan-y;
|
20 |
+
}
|
21 |
+
.owl-carousel .owl-wrapper{
|
22 |
+
display: none;
|
23 |
+
position: relative;
|
24 |
+
-webkit-transform: translate3d(0px, 0px, 0px);
|
25 |
+
}
|
26 |
+
.owl-carousel .owl-wrapper-outer{
|
27 |
+
overflow: hidden;
|
28 |
+
position: relative;
|
29 |
+
width: 100%;
|
30 |
+
}
|
31 |
+
.owl-carousel .owl-wrapper-outer.autoHeight{
|
32 |
+
-webkit-transition: height 500ms ease-in-out;
|
33 |
+
-moz-transition: height 500ms ease-in-out;
|
34 |
+
-ms-transition: height 500ms ease-in-out;
|
35 |
+
-o-transition: height 500ms ease-in-out;
|
36 |
+
transition: height 500ms ease-in-out;
|
37 |
+
}
|
38 |
+
|
39 |
+
.owl-carousel .owl-item{
|
40 |
+
float: left;
|
41 |
+
}
|
42 |
+
.owl-controls .owl-page,
|
43 |
+
.owl-controls .owl-buttons div{
|
44 |
+
cursor: pointer;
|
45 |
+
}
|
46 |
+
.owl-controls {
|
47 |
+
-webkit-user-select: none;
|
48 |
+
-khtml-user-select: none;
|
49 |
+
-moz-user-select: none;
|
50 |
+
-ms-user-select: none;
|
51 |
+
user-select: none;
|
52 |
+
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
53 |
+
}
|
54 |
+
|
55 |
+
/* mouse grab icon */
|
56 |
+
.grabbing {
|
57 |
+
cursor:url(grabbing.png) 8 8, move;
|
58 |
+
}
|
59 |
+
|
60 |
+
/* fix */
|
61 |
+
.owl-carousel .owl-wrapper,
|
62 |
+
.owl-carousel .owl-item{
|
63 |
+
-webkit-backface-visibility: hidden;
|
64 |
+
-moz-backface-visibility: hidden;
|
65 |
+
-ms-backface-visibility: hidden;
|
66 |
+
-webkit-transform: translate3d(0,0,0);
|
67 |
+
-moz-transform: translate3d(0,0,0);
|
68 |
+
-ms-transform: translate3d(0,0,0);
|
69 |
+
}
|
70 |
+
|
css/owl.theme.css
ADDED
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* Owl Carousel Owl Demo Theme
|
3 |
+
* v1.3.2
|
4 |
+
*/
|
5 |
+
|
6 |
+
.owl-theme .owl-controls{
|
7 |
+
margin-top: 10px;
|
8 |
+
text-align: center;
|
9 |
+
}
|
10 |
+
|
11 |
+
/* Styling Next and Prev buttons */
|
12 |
+
|
13 |
+
.owl-theme .owl-controls .owl-buttons div{
|
14 |
+
display: inline-block;
|
15 |
+
zoom: 1;
|
16 |
+
*display: inline;/*IE7 life-saver */
|
17 |
+
margin: 5px;
|
18 |
+
padding: 3px 10px;
|
19 |
+
font-size: 12px;
|
20 |
+
-webkit-border-radius: 30px;
|
21 |
+
-moz-border-radius: 30px;
|
22 |
+
border-radius: 30px;
|
23 |
+
filter: Alpha(Opacity=50);/*IE7 fix*/
|
24 |
+
opacity: 0.5;
|
25 |
+
}
|
26 |
+
/* Clickable class fix problem with hover on touch devices */
|
27 |
+
/* Use it for non-touch hover action */
|
28 |
+
.owl-theme .owl-controls.clickable .owl-buttons div:hover{
|
29 |
+
filter: Alpha(Opacity=100);/*IE7 fix*/
|
30 |
+
opacity: 1;
|
31 |
+
text-decoration: none;
|
32 |
+
}
|
33 |
+
|
34 |
+
/* Styling Pagination*/
|
35 |
+
|
36 |
+
.owl-theme .owl-controls .owl-page{
|
37 |
+
display: inline-block;
|
38 |
+
zoom: 1;
|
39 |
+
*display: inline;/*IE7 life-saver */
|
40 |
+
}
|
41 |
+
.owl-theme .owl-controls .owl-page span{
|
42 |
+
display: block;
|
43 |
+
width: 12px;
|
44 |
+
height: 12px;
|
45 |
+
margin: 5px 7px;
|
46 |
+
filter: Alpha(Opacity=50);/*IE7 fix*/
|
47 |
+
opacity: 0.5;
|
48 |
+
-webkit-border-radius: 20px;
|
49 |
+
-moz-border-radius: 20px;
|
50 |
+
border-radius: 20px;
|
51 |
+
}
|
52 |
+
|
53 |
+
.owl-theme .owl-controls .owl-page.active span,
|
54 |
+
.owl-theme .owl-controls.clickable .owl-page:hover span{
|
55 |
+
filter: Alpha(Opacity=100);/*IE7 fix*/
|
56 |
+
opacity: 1;
|
57 |
+
}
|
58 |
+
|
59 |
+
/* If PaginationNumbers is true */
|
60 |
+
|
61 |
+
.owl-theme .owl-controls .owl-page span.owl-numbers{
|
62 |
+
height: auto;
|
63 |
+
width: auto;
|
64 |
+
padding: 2px 10px;
|
65 |
+
font-size: 12px;
|
66 |
+
-webkit-border-radius: 30px;
|
67 |
+
-moz-border-radius: 30px;
|
68 |
+
border-radius: 30px;
|
69 |
+
}
|
70 |
+
|
71 |
+
/* preloading images */
|
72 |
+
.owl-controls{position: relative;}
|
73 |
+
.owl-buttons {
|
74 |
+
position: absolute;
|
75 |
+
width: 100%;
|
76 |
+
top: 0;
|
77 |
+
}
|
78 |
+
.owl-prev {
|
79 |
+
left: 10px;
|
80 |
+
position: absolute;
|
81 |
+
}
|
82 |
+
.owl-next {
|
83 |
+
right: 10px;
|
84 |
+
position: absolute;
|
85 |
+
}
|
86 |
+
.owl-item img {
|
87 |
+
width: 100%;
|
88 |
+
height: auto;
|
89 |
+
}
|
css/owl.transitions.css
ADDED
@@ -0,0 +1,163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* Owl Carousel CSS3 Transitions
|
3 |
+
* v1.3.2
|
4 |
+
*/
|
5 |
+
|
6 |
+
.owl-origin {
|
7 |
+
-webkit-perspective: 1200px;
|
8 |
+
-webkit-perspective-origin-x : 50%;
|
9 |
+
-webkit-perspective-origin-y : 50%;
|
10 |
+
-moz-perspective : 1200px;
|
11 |
+
-moz-perspective-origin-x : 50%;
|
12 |
+
-moz-perspective-origin-y : 50%;
|
13 |
+
perspective : 1200px;
|
14 |
+
}
|
15 |
+
/* fade */
|
16 |
+
.owl-fade-out {
|
17 |
+
z-index: 10;
|
18 |
+
-webkit-animation: fadeOut .7s both ease;
|
19 |
+
-moz-animation: fadeOut .7s both ease;
|
20 |
+
animation: fadeOut .7s both ease;
|
21 |
+
}
|
22 |
+
.owl-fade-in {
|
23 |
+
-webkit-animation: fadeIn .7s both ease;
|
24 |
+
-moz-animation: fadeIn .7s both ease;
|
25 |
+
animation: fadeIn .7s both ease;
|
26 |
+
}
|
27 |
+
/* backSlide */
|
28 |
+
.owl-backSlide-out {
|
29 |
+
-webkit-animation: backSlideOut 1s both ease;
|
30 |
+
-moz-animation: backSlideOut 1s both ease;
|
31 |
+
animation: backSlideOut 1s both ease;
|
32 |
+
}
|
33 |
+
.owl-backSlide-in {
|
34 |
+
-webkit-animation: backSlideIn 1s both ease;
|
35 |
+
-moz-animation: backSlideIn 1s both ease;
|
36 |
+
animation: backSlideIn 1s both ease;
|
37 |
+
}
|
38 |
+
/* goDown */
|
39 |
+
.owl-goDown-out {
|
40 |
+
-webkit-animation: scaleToFade .7s ease both;
|
41 |
+
-moz-animation: scaleToFade .7s ease both;
|
42 |
+
animation: scaleToFade .7s ease both;
|
43 |
+
}
|
44 |
+
.owl-goDown-in {
|
45 |
+
-webkit-animation: goDown .6s ease both;
|
46 |
+
-moz-animation: goDown .6s ease both;
|
47 |
+
animation: goDown .6s ease both;
|
48 |
+
}
|
49 |
+
/* scaleUp */
|
50 |
+
.owl-fadeUp-in {
|
51 |
+
-webkit-animation: scaleUpFrom .5s ease both;
|
52 |
+
-moz-animation: scaleUpFrom .5s ease both;
|
53 |
+
animation: scaleUpFrom .5s ease both;
|
54 |
+
}
|
55 |
+
|
56 |
+
.owl-fadeUp-out {
|
57 |
+
-webkit-animation: scaleUpTo .5s ease both;
|
58 |
+
-moz-animation: scaleUpTo .5s ease both;
|
59 |
+
animation: scaleUpTo .5s ease both;
|
60 |
+
}
|
61 |
+
/* Keyframes */
|
62 |
+
/*empty*/
|
63 |
+
@-webkit-keyframes empty {
|
64 |
+
0% {opacity: 1}
|
65 |
+
}
|
66 |
+
@-moz-keyframes empty {
|
67 |
+
0% {opacity: 1}
|
68 |
+
}
|
69 |
+
@keyframes empty {
|
70 |
+
0% {opacity: 1}
|
71 |
+
}
|
72 |
+
@-webkit-keyframes fadeIn {
|
73 |
+
0% { opacity:0; }
|
74 |
+
100% { opacity:1; }
|
75 |
+
}
|
76 |
+
@-moz-keyframes fadeIn {
|
77 |
+
0% { opacity:0; }
|
78 |
+
100% { opacity:1; }
|
79 |
+
}
|
80 |
+
@keyframes fadeIn {
|
81 |
+
0% { opacity:0; }
|
82 |
+
100% { opacity:1; }
|
83 |
+
}
|
84 |
+
@-webkit-keyframes fadeOut {
|
85 |
+
0% { opacity:1; }
|
86 |
+
100% { opacity:0; }
|
87 |
+
}
|
88 |
+
@-moz-keyframes fadeOut {
|
89 |
+
0% { opacity:1; }
|
90 |
+
100% { opacity:0; }
|
91 |
+
}
|
92 |
+
@keyframes fadeOut {
|
93 |
+
0% { opacity:1; }
|
94 |
+
100% { opacity:0; }
|
95 |
+
}
|
96 |
+
@-webkit-keyframes backSlideOut {
|
97 |
+
25% { opacity: .5; -webkit-transform: translateZ(-500px); }
|
98 |
+
75% { opacity: .5; -webkit-transform: translateZ(-500px) translateX(-200%); }
|
99 |
+
100% { opacity: .5; -webkit-transform: translateZ(-500px) translateX(-200%); }
|
100 |
+
}
|
101 |
+
@-moz-keyframes backSlideOut {
|
102 |
+
25% { opacity: .5; -moz-transform: translateZ(-500px); }
|
103 |
+
75% { opacity: .5; -moz-transform: translateZ(-500px) translateX(-200%); }
|
104 |
+
100% { opacity: .5; -moz-transform: translateZ(-500px) translateX(-200%); }
|
105 |
+
}
|
106 |
+
@keyframes backSlideOut {
|
107 |
+
25% { opacity: .5; transform: translateZ(-500px); }
|
108 |
+
75% { opacity: .5; transform: translateZ(-500px) translateX(-200%); }
|
109 |
+
100% { opacity: .5; transform: translateZ(-500px) translateX(-200%); }
|
110 |
+
}
|
111 |
+
@-webkit-keyframes backSlideIn {
|
112 |
+
0%, 25% { opacity: .5; -webkit-transform: translateZ(-500px) translateX(200%); }
|
113 |
+
75% { opacity: .5; -webkit-transform: translateZ(-500px); }
|
114 |
+
100% { opacity: 1; -webkit-transform: translateZ(0) translateX(0); }
|
115 |
+
}
|
116 |
+
@-moz-keyframes backSlideIn {
|
117 |
+
0%, 25% { opacity: .5; -moz-transform: translateZ(-500px) translateX(200%); }
|
118 |
+
75% { opacity: .5; -moz-transform: translateZ(-500px); }
|
119 |
+
100% { opacity: 1; -moz-transform: translateZ(0) translateX(0); }
|
120 |
+
}
|
121 |
+
@keyframes backSlideIn {
|
122 |
+
0%, 25% { opacity: .5; transform: translateZ(-500px) translateX(200%); }
|
123 |
+
75% { opacity: .5; transform: translateZ(-500px); }
|
124 |
+
100% { opacity: 1; transform: translateZ(0) translateX(0); }
|
125 |
+
}
|
126 |
+
@-webkit-keyframes scaleToFade {
|
127 |
+
to { opacity: 0; -webkit-transform: scale(.8); }
|
128 |
+
}
|
129 |
+
@-moz-keyframes scaleToFade {
|
130 |
+
to { opacity: 0; -moz-transform: scale(.8); }
|
131 |
+
}
|
132 |
+
@keyframes scaleToFade {
|
133 |
+
to { opacity: 0; transform: scale(.8); }
|
134 |
+
}
|
135 |
+
@-webkit-keyframes goDown {
|
136 |
+
from { -webkit-transform: translateY(-100%); }
|
137 |
+
}
|
138 |
+
@-moz-keyframes goDown {
|
139 |
+
from { -moz-transform: translateY(-100%); }
|
140 |
+
}
|
141 |
+
@keyframes goDown {
|
142 |
+
from { transform: translateY(-100%); }
|
143 |
+
}
|
144 |
+
|
145 |
+
@-webkit-keyframes scaleUpFrom {
|
146 |
+
from { opacity: 0; -webkit-transform: scale(1.5); }
|
147 |
+
}
|
148 |
+
@-moz-keyframes scaleUpFrom {
|
149 |
+
from { opacity: 0; -moz-transform: scale(1.5); }
|
150 |
+
}
|
151 |
+
@keyframes scaleUpFrom {
|
152 |
+
from { opacity: 0; transform: scale(1.5); }
|
153 |
+
}
|
154 |
+
|
155 |
+
@-webkit-keyframes scaleUpTo {
|
156 |
+
to { opacity: 0; -webkit-transform: scale(1.5); }
|
157 |
+
}
|
158 |
+
@-moz-keyframes scaleUpTo {
|
159 |
+
to { opacity: 0; -moz-transform: scale(1.5); }
|
160 |
+
}
|
161 |
+
@keyframes scaleUpTo {
|
162 |
+
to { opacity: 0; transform: scale(1.5); }
|
163 |
+
}
|
js/carousel-button.js
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function() {
|
2 |
+
tinymce.create('tinymce.plugins.sisCarousel', {
|
3 |
+
|
4 |
+
init : function(ed, url) {
|
5 |
+
ed.addCommand('siscarouseltriger', function() {
|
6 |
+
return_text = '[carousel id=""][item img_link=""][item img_link=""][item img_link=""][item img_link=""][item img_link=""][/carousel]';
|
7 |
+
ed.execCommand('mceInsertContent', 0, return_text);
|
8 |
+
});
|
9 |
+
|
10 |
+
|
11 |
+
ed.addButton('siscarouseltriger', {
|
12 |
+
title : 'Add Carousel Slider',
|
13 |
+
cmd : 'siscarouseltriger',
|
14 |
+
image : url + '/carousel.png'
|
15 |
+
});
|
16 |
+
|
17 |
+
},
|
18 |
+
createControl : function(n, cm) {
|
19 |
+
return null;
|
20 |
+
},
|
21 |
+
});
|
22 |
+
|
23 |
+
// Register plugin
|
24 |
+
tinymce.PluginManager.add('siscours', tinymce.plugins.sisCarousel);
|
25 |
+
})();
|
js/carousel-color-script.js
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function($){
|
2 |
+
$('#navigation_bg_color').wpColorPicker();
|
3 |
+
$('#navigation_arrow_color').wpColorPicker();
|
4 |
+
$('#pagination_bg_color').wpColorPicker();
|
5 |
+
$('#pagination_num_color').wpColorPicker();
|
6 |
+
});
|
js/carousel.png
ADDED
Binary file
|
js/owl.carousel.js
ADDED
@@ -0,0 +1,1512 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* jQuery OwlCarousel v1.3.2
|
3 |
+
*
|
4 |
+
* Copyright (c) 2013 Bartosz Wojciechowski
|
5 |
+
* http://www.owlgraphic.com/owlcarousel/
|
6 |
+
*
|
7 |
+
* Licensed under MIT
|
8 |
+
*
|
9 |
+
*/
|
10 |
+
|
11 |
+
/*JS Lint helpers: */
|
12 |
+
/*global dragMove: false, dragEnd: false, $, jQuery, alert, window, document */
|
13 |
+
/*jslint nomen: true, continue:true */
|
14 |
+
|
15 |
+
if (typeof Object.create !== "function") {
|
16 |
+
Object.create = function (obj) {
|
17 |
+
function F() {}
|
18 |
+
F.prototype = obj;
|
19 |
+
return new F();
|
20 |
+
};
|
21 |
+
}
|
22 |
+
(function ($, window, document) {
|
23 |
+
|
24 |
+
var Carousel = {
|
25 |
+
init : function (options, el) {
|
26 |
+
var base = this;
|
27 |
+
|
28 |
+
base.$elem = $(el);
|
29 |
+
base.options = $.extend({}, $.fn.owlCarousel.options, base.$elem.data(), options);
|
30 |
+
|
31 |
+
base.userOptions = options;
|
32 |
+
base.loadContent();
|
33 |
+
},
|
34 |
+
|
35 |
+
loadContent : function () {
|
36 |
+
var base = this, url;
|
37 |
+
|
38 |
+
function getData(data) {
|
39 |
+
var i, content = "";
|
40 |
+
if (typeof base.options.jsonSuccess === "function") {
|
41 |
+
base.options.jsonSuccess.apply(this, [data]);
|
42 |
+
} else {
|
43 |
+
for (i in data.owl) {
|
44 |
+
if (data.owl.hasOwnProperty(i)) {
|
45 |
+
content += data.owl[i].item;
|
46 |
+
}
|
47 |
+
}
|
48 |
+
base.$elem.html(content);
|
49 |
+
}
|
50 |
+
base.logIn();
|
51 |
+
}
|
52 |
+
|
53 |
+
if (typeof base.options.beforeInit === "function") {
|
54 |
+
base.options.beforeInit.apply(this, [base.$elem]);
|
55 |
+
}
|
56 |
+
|
57 |
+
if (typeof base.options.jsonPath === "string") {
|
58 |
+
url = base.options.jsonPath;
|
59 |
+
$.getJSON(url, getData);
|
60 |
+
} else {
|
61 |
+
base.logIn();
|
62 |
+
}
|
63 |
+
},
|
64 |
+
|
65 |
+
logIn : function () {
|
66 |
+
var base = this;
|
67 |
+
|
68 |
+
base.$elem.data("owl-originalStyles", base.$elem.attr("style"))
|
69 |
+
.data("owl-originalClasses", base.$elem.attr("class"));
|
70 |
+
|
71 |
+
base.$elem.css({opacity: 0});
|
72 |
+
base.orignalItems = base.options.items;
|
73 |
+
base.checkBrowser();
|
74 |
+
base.wrapperWidth = 0;
|
75 |
+
base.checkVisible = null;
|
76 |
+
base.setVars();
|
77 |
+
},
|
78 |
+
|
79 |
+
setVars : function () {
|
80 |
+
var base = this;
|
81 |
+
if (base.$elem.children().length === 0) {return false; }
|
82 |
+
base.baseClass();
|
83 |
+
base.eventTypes();
|
84 |
+
base.$userItems = base.$elem.children();
|
85 |
+
base.itemsAmount = base.$userItems.length;
|
86 |
+
base.wrapItems();
|
87 |
+
base.$owlItems = base.$elem.find(".owl-item");
|
88 |
+
base.$owlWrapper = base.$elem.find(".owl-wrapper");
|
89 |
+
base.playDirection = "next";
|
90 |
+
base.prevItem = 0;
|
91 |
+
base.prevArr = [0];
|
92 |
+
base.currentItem = 0;
|
93 |
+
base.customEvents();
|
94 |
+
base.onStartup();
|
95 |
+
},
|
96 |
+
|
97 |
+
onStartup : function () {
|
98 |
+
var base = this;
|
99 |
+
base.updateItems();
|
100 |
+
base.calculateAll();
|
101 |
+
base.buildControls();
|
102 |
+
base.updateControls();
|
103 |
+
base.response();
|
104 |
+
base.moveEvents();
|
105 |
+
base.stopOnHover();
|
106 |
+
base.owlStatus();
|
107 |
+
|
108 |
+
if (base.options.transitionStyle !== false) {
|
109 |
+
base.transitionTypes(base.options.transitionStyle);
|
110 |
+
}
|
111 |
+
if (base.options.autoPlay === true) {
|
112 |
+
base.options.autoPlay = 5000;
|
113 |
+
}
|
114 |
+
base.play();
|
115 |
+
|
116 |
+
base.$elem.find(".owl-wrapper").css("display", "block");
|
117 |
+
|
118 |
+
if (!base.$elem.is(":visible")) {
|
119 |
+
base.watchVisibility();
|
120 |
+
} else {
|
121 |
+
base.$elem.css("opacity", 1);
|
122 |
+
}
|
123 |
+
base.onstartup = false;
|
124 |
+
base.eachMoveUpdate();
|
125 |
+
if (typeof base.options.afterInit === "function") {
|
126 |
+
base.options.afterInit.apply(this, [base.$elem]);
|
127 |
+
}
|
128 |
+
},
|
129 |
+
|
130 |
+
eachMoveUpdate : function () {
|
131 |
+
var base = this;
|
132 |
+
|
133 |
+
if (base.options.lazyLoad === true) {
|
134 |
+
base.lazyLoad();
|
135 |
+
}
|
136 |
+
if (base.options.autoHeight === true) {
|
137 |
+
base.autoHeight();
|
138 |
+
}
|
139 |
+
base.onVisibleItems();
|
140 |
+
|
141 |
+
if (typeof base.options.afterAction === "function") {
|
142 |
+
base.options.afterAction.apply(this, [base.$elem]);
|
143 |
+
}
|
144 |
+
},
|
145 |
+
|
146 |
+
updateVars : function () {
|
147 |
+
var base = this;
|
148 |
+
if (typeof base.options.beforeUpdate === "function") {
|
149 |
+
base.options.beforeUpdate.apply(this, [base.$elem]);
|
150 |
+
}
|
151 |
+
base.watchVisibility();
|
152 |
+
base.updateItems();
|
153 |
+
base.calculateAll();
|
154 |
+
base.updatePosition();
|
155 |
+
base.updateControls();
|
156 |
+
base.eachMoveUpdate();
|
157 |
+
if (typeof base.options.afterUpdate === "function") {
|
158 |
+
base.options.afterUpdate.apply(this, [base.$elem]);
|
159 |
+
}
|
160 |
+
},
|
161 |
+
|
162 |
+
reload : function () {
|
163 |
+
var base = this;
|
164 |
+
window.setTimeout(function () {
|
165 |
+
base.updateVars();
|
166 |
+
}, 0);
|
167 |
+
},
|
168 |
+
|
169 |
+
watchVisibility : function () {
|
170 |
+
var base = this;
|
171 |
+
|
172 |
+
if (base.$elem.is(":visible") === false) {
|
173 |
+
base.$elem.css({opacity: 0});
|
174 |
+
window.clearInterval(base.autoPlayInterval);
|
175 |
+
window.clearInterval(base.checkVisible);
|
176 |
+
} else {
|
177 |
+
return false;
|
178 |
+
}
|
179 |
+
base.checkVisible = window.setInterval(function () {
|
180 |
+
if (base.$elem.is(":visible")) {
|
181 |
+
base.reload();
|
182 |
+
base.$elem.animate({opacity: 1}, 200);
|
183 |
+
window.clearInterval(base.checkVisible);
|
184 |
+
}
|
185 |
+
}, 500);
|
186 |
+
},
|
187 |
+
|
188 |
+
wrapItems : function () {
|
189 |
+
var base = this;
|
190 |
+
base.$userItems.wrapAll("<div class=\"owl-wrapper\">").wrap("<div class=\"owl-item\"></div>");
|
191 |
+
base.$elem.find(".owl-wrapper").wrap("<div class=\"owl-wrapper-outer\">");
|
192 |
+
base.wrapperOuter = base.$elem.find(".owl-wrapper-outer");
|
193 |
+
base.$elem.css("display", "block");
|
194 |
+
},
|
195 |
+
|
196 |
+
baseClass : function () {
|
197 |
+
var base = this,
|
198 |
+
hasBaseClass = base.$elem.hasClass(base.options.baseClass),
|
199 |
+
hasThemeClass = base.$elem.hasClass(base.options.theme);
|
200 |
+
|
201 |
+
if (!hasBaseClass) {
|
202 |
+
base.$elem.addClass(base.options.baseClass);
|
203 |
+
}
|
204 |
+
|
205 |
+
if (!hasThemeClass) {
|
206 |
+
base.$elem.addClass(base.options.theme);
|
207 |
+
}
|
208 |
+
},
|
209 |
+
|
210 |
+
updateItems : function () {
|
211 |
+
var base = this, width, i;
|
212 |
+
|
213 |
+
if (base.options.responsive === false) {
|
214 |
+
return false;
|
215 |
+
}
|
216 |
+
if (base.options.singleItem === true) {
|
217 |
+
base.options.items = base.orignalItems = 1;
|
218 |
+
base.options.itemsCustom = false;
|
219 |
+
base.options.itemsDesktop = false;
|
220 |
+
base.options.itemsDesktopSmall = false;
|
221 |
+
base.options.itemsTablet = false;
|
222 |
+
base.options.itemsTabletSmall = false;
|
223 |
+
base.options.itemsMobile = false;
|
224 |
+
return false;
|
225 |
+
}
|
226 |
+
|
227 |
+
width = $(base.options.responsiveBaseWidth).width();
|
228 |
+
|
229 |
+
if (width > (base.options.itemsDesktop[0] || base.orignalItems)) {
|
230 |
+
base.options.items = base.orignalItems;
|
231 |
+
}
|
232 |
+
if (base.options.itemsCustom !== false) {
|
233 |
+
//Reorder array by screen size
|
234 |
+
base.options.itemsCustom.sort(function (a, b) {return a[0] - b[0]; });
|
235 |
+
|
236 |
+
for (i = 0; i < base.options.itemsCustom.length; i += 1) {
|
237 |
+
if (base.options.itemsCustom[i][0] <= width) {
|
238 |
+
base.options.items = base.options.itemsCustom[i][1];
|
239 |
+
}
|
240 |
+
}
|
241 |
+
|
242 |
+
} else {
|
243 |
+
|
244 |
+
if (width <= base.options.itemsDesktop[0] && base.options.itemsDesktop !== false) {
|
245 |
+
base.options.items = base.options.itemsDesktop[1];
|
246 |
+
}
|
247 |
+
|
248 |
+
if (width <= base.options.itemsDesktopSmall[0] && base.options.itemsDesktopSmall !== false) {
|
249 |
+
base.options.items = base.options.itemsDesktopSmall[1];
|
250 |
+
}
|
251 |
+
|
252 |
+
if (width <= base.options.itemsTablet[0] && base.options.itemsTablet !== false) {
|
253 |
+
base.options.items = base.options.itemsTablet[1];
|
254 |
+
}
|
255 |
+
|
256 |
+
if (width <= base.options.itemsTabletSmall[0] && base.options.itemsTabletSmall !== false) {
|
257 |
+
base.options.items = base.options.itemsTabletSmall[1];
|
258 |
+
}
|
259 |
+
|
260 |
+
if (width <= base.options.itemsMobile[0] && base.options.itemsMobile !== false) {
|
261 |
+
base.options.items = base.options.itemsMobile[1];
|
262 |
+
}
|
263 |
+
}
|
264 |
+
|
265 |
+
//if number of items is less than declared
|
266 |
+
if (base.options.items > base.itemsAmount && base.options.itemsScaleUp === true) {
|
267 |
+
base.options.items = base.itemsAmount;
|
268 |
+
}
|
269 |
+
},
|
270 |
+
|
271 |
+
response : function () {
|
272 |
+
var base = this,
|
273 |
+
smallDelay,
|
274 |
+
lastWindowWidth;
|
275 |
+
|
276 |
+
if (base.options.responsive !== true) {
|
277 |
+
return false;
|
278 |
+
}
|
279 |
+
lastWindowWidth = $(window).width();
|
280 |
+
|
281 |
+
base.resizer = function () {
|
282 |
+
if ($(window).width() !== lastWindowWidth) {
|
283 |
+
if (base.options.autoPlay !== false) {
|
284 |
+
window.clearInterval(base.autoPlayInterval);
|
285 |
+
}
|
286 |
+
window.clearTimeout(smallDelay);
|
287 |
+
smallDelay = window.setTimeout(function () {
|
288 |
+
lastWindowWidth = $(window).width();
|
289 |
+
base.updateVars();
|
290 |
+
}, base.options.responsiveRefreshRate);
|
291 |
+
}
|
292 |
+
};
|
293 |
+
$(window).resize(base.resizer);
|
294 |
+
},
|
295 |
+
|
296 |
+
updatePosition : function () {
|
297 |
+
var base = this;
|
298 |
+
base.jumpTo(base.currentItem);
|
299 |
+
if (base.options.autoPlay !== false) {
|
300 |
+
base.checkAp();
|
301 |
+
}
|
302 |
+
},
|
303 |
+
|
304 |
+
appendItemsSizes : function () {
|
305 |
+
var base = this,
|
306 |
+
roundPages = 0,
|
307 |
+
lastItem = base.itemsAmount - base.options.items;
|
308 |
+
|
309 |
+
base.$owlItems.each(function (index) {
|
310 |
+
var $this = $(this);
|
311 |
+
$this
|
312 |
+
.css({"width": base.itemWidth})
|
313 |
+
.data("owl-item", Number(index));
|
314 |
+
|
315 |
+
if (index % base.options.items === 0 || index === lastItem) {
|
316 |
+
if (!(index > lastItem)) {
|
317 |
+
roundPages += 1;
|
318 |
+
}
|
319 |
+
}
|
320 |
+
$this.data("owl-roundPages", roundPages);
|
321 |
+
});
|
322 |
+
},
|
323 |
+
|
324 |
+
appendWrapperSizes : function () {
|
325 |
+
var base = this,
|
326 |
+
width = base.$owlItems.length * base.itemWidth;
|
327 |
+
|
328 |
+
base.$owlWrapper.css({
|
329 |
+
"width": width * 2,
|
330 |
+
"left": 0
|
331 |
+
});
|
332 |
+
base.appendItemsSizes();
|
333 |
+
},
|
334 |
+
|
335 |
+
calculateAll : function () {
|
336 |
+
var base = this;
|
337 |
+
base.calculateWidth();
|
338 |
+
base.appendWrapperSizes();
|
339 |
+
base.loops();
|
340 |
+
base.max();
|
341 |
+
},
|
342 |
+
|
343 |
+
calculateWidth : function () {
|
344 |
+
var base = this;
|
345 |
+
base.itemWidth = Math.round(base.$elem.width() / base.options.items);
|
346 |
+
},
|
347 |
+
|
348 |
+
max : function () {
|
349 |
+
var base = this,
|
350 |
+
maximum = ((base.itemsAmount * base.itemWidth) - base.options.items * base.itemWidth) * -1;
|
351 |
+
if (base.options.items > base.itemsAmount) {
|
352 |
+
base.maximumItem = 0;
|
353 |
+
maximum = 0;
|
354 |
+
base.maximumPixels = 0;
|
355 |
+
} else {
|
356 |
+
base.maximumItem = base.itemsAmount - base.options.items;
|
357 |
+
base.maximumPixels = maximum;
|
358 |
+
}
|
359 |
+
return maximum;
|
360 |
+
},
|
361 |
+
|
362 |
+
min : function () {
|
363 |
+
return 0;
|
364 |
+
},
|
365 |
+
|
366 |
+
loops : function () {
|
367 |
+
var base = this,
|
368 |
+
prev = 0,
|
369 |
+
elWidth = 0,
|
370 |
+
i,
|
371 |
+
item,
|
372 |
+
roundPageNum;
|
373 |
+
|
374 |
+
base.positionsInArray = [0];
|
375 |
+
base.pagesInArray = [];
|
376 |
+
|
377 |
+
for (i = 0; i < base.itemsAmount; i += 1) {
|
378 |
+
elWidth += base.itemWidth;
|
379 |
+
base.positionsInArray.push(-elWidth);
|
380 |
+
|
381 |
+
if (base.options.scrollPerPage === true) {
|
382 |
+
item = $(base.$owlItems[i]);
|
383 |
+
roundPageNum = item.data("owl-roundPages");
|
384 |
+
if (roundPageNum !== prev) {
|
385 |
+
base.pagesInArray[prev] = base.positionsInArray[i];
|
386 |
+
prev = roundPageNum;
|
387 |
+
}
|
388 |
+
}
|
389 |
+
}
|
390 |
+
},
|
391 |
+
|
392 |
+
buildControls : function () {
|
393 |
+
var base = this;
|
394 |
+
if (base.options.navigation === true || base.options.pagination === true) {
|
395 |
+
base.owlControls = $("<div class=\"owl-controls\"/>").toggleClass("clickable", !base.browser.isTouch).appendTo(base.$elem);
|
396 |
+
}
|
397 |
+
if (base.options.pagination === true) {
|
398 |
+
base.buildPagination();
|
399 |
+
}
|
400 |
+
if (base.options.navigation === true) {
|
401 |
+
base.buildButtons();
|
402 |
+
}
|
403 |
+
},
|
404 |
+
|
405 |
+
buildButtons : function () {
|
406 |
+
var base = this,
|
407 |
+
buttonsWrapper = $("<div class=\"owl-buttons\"/>");
|
408 |
+
base.owlControls.append(buttonsWrapper);
|
409 |
+
|
410 |
+
base.buttonPrev = $("<div/>", {
|
411 |
+
"class" : "owl-prev",
|
412 |
+
"html" : base.options.navigationText[0] || ""
|
413 |
+
});
|
414 |
+
|
415 |
+
base.buttonNext = $("<div/>", {
|
416 |
+
"class" : "owl-next",
|
417 |
+
"html" : base.options.navigationText[1] || ""
|
418 |
+
});
|
419 |
+
|
420 |
+
buttonsWrapper
|
421 |
+
.append(base.buttonPrev)
|
422 |
+
.append(base.buttonNext);
|
423 |
+
|
424 |
+
buttonsWrapper.on("touchstart.owlControls mousedown.owlControls", "div[class^=\"owl\"]", function (event) {
|
425 |
+
event.preventDefault();
|
426 |
+
});
|
427 |
+
|
428 |
+
buttonsWrapper.on("touchend.owlControls mouseup.owlControls", "div[class^=\"owl\"]", function (event) {
|
429 |
+
event.preventDefault();
|
430 |
+
if ($(this).hasClass("owl-next")) {
|
431 |
+
base.next();
|
432 |
+
} else {
|
433 |
+
base.prev();
|
434 |
+
}
|
435 |
+
});
|
436 |
+
},
|
437 |
+
|
438 |
+
buildPagination : function () {
|
439 |
+
var base = this;
|
440 |
+
|
441 |
+
base.paginationWrapper = $("<div class=\"owl-pagination\"/>");
|
442 |
+
base.owlControls.append(base.paginationWrapper);
|
443 |
+
|
444 |
+
base.paginationWrapper.on("touchend.owlControls mouseup.owlControls", ".owl-page", function (event) {
|
445 |
+
event.preventDefault();
|
446 |
+
if (Number($(this).data("owl-page")) !== base.currentItem) {
|
447 |
+
base.goTo(Number($(this).data("owl-page")), true);
|
448 |
+
}
|
449 |
+
});
|
450 |
+
},
|
451 |
+
|
452 |
+
updatePagination : function () {
|
453 |
+
var base = this,
|
454 |
+
counter,
|
455 |
+
lastPage,
|
456 |
+
lastItem,
|
457 |
+
i,
|
458 |
+
paginationButton,
|
459 |
+
paginationButtonInner;
|
460 |
+
|
461 |
+
if (base.options.pagination === false) {
|
462 |
+
return false;
|
463 |
+
}
|
464 |
+
|
465 |
+
base.paginationWrapper.html("");
|
466 |
+
|
467 |
+
counter = 0;
|
468 |
+
lastPage = base.itemsAmount - base.itemsAmount % base.options.items;
|
469 |
+
|
470 |
+
for (i = 0; i < base.itemsAmount; i += 1) {
|
471 |
+
if (i % base.options.items === 0) {
|
472 |
+
counter += 1;
|
473 |
+
if (lastPage === i) {
|
474 |
+
lastItem = base.itemsAmount - base.options.items;
|
475 |
+
}
|
476 |
+
paginationButton = $("<div/>", {
|
477 |
+
"class" : "owl-page"
|
478 |
+
});
|
479 |
+
paginationButtonInner = $("<span></span>", {
|
480 |
+
"text": base.options.paginationNumbers === true ? counter : "",
|
481 |
+
"class": base.options.paginationNumbers === true ? "owl-numbers" : ""
|
482 |
+
});
|
483 |
+
paginationButton.append(paginationButtonInner);
|
484 |
+
|
485 |
+
paginationButton.data("owl-page", lastPage === i ? lastItem : i);
|
486 |
+
paginationButton.data("owl-roundPages", counter);
|
487 |
+
|
488 |
+
base.paginationWrapper.append(paginationButton);
|
489 |
+
}
|
490 |
+
}
|
491 |
+
base.checkPagination();
|
492 |
+
},
|
493 |
+
checkPagination : function () {
|
494 |
+
var base = this;
|
495 |
+
if (base.options.pagination === false) {
|
496 |
+
return false;
|
497 |
+
}
|
498 |
+
base.paginationWrapper.find(".owl-page").each(function () {
|
499 |
+
if ($(this).data("owl-roundPages") === $(base.$owlItems[base.currentItem]).data("owl-roundPages")) {
|
500 |
+
base.paginationWrapper
|
501 |
+
.find(".owl-page")
|
502 |
+
.removeClass("active");
|
503 |
+
$(this).addClass("active");
|
504 |
+
}
|
505 |
+
});
|
506 |
+
},
|
507 |
+
|
508 |
+
checkNavigation : function () {
|
509 |
+
var base = this;
|
510 |
+
|
511 |
+
if (base.options.navigation === false) {
|
512 |
+
return false;
|
513 |
+
}
|
514 |
+
if (base.options.rewindNav === false) {
|
515 |
+
if (base.currentItem === 0 && base.maximumItem === 0) {
|
516 |
+
base.buttonPrev.addClass("disabled");
|
517 |
+
base.buttonNext.addClass("disabled");
|
518 |
+
} else if (base.currentItem === 0 && base.maximumItem !== 0) {
|
519 |
+
base.buttonPrev.addClass("disabled");
|
520 |
+
base.buttonNext.removeClass("disabled");
|
521 |
+
} else if (base.currentItem === base.maximumItem) {
|
522 |
+
base.buttonPrev.removeClass("disabled");
|
523 |
+
base.buttonNext.addClass("disabled");
|
524 |
+
} else if (base.currentItem !== 0 && base.currentItem !== base.maximumItem) {
|
525 |
+
base.buttonPrev.removeClass("disabled");
|
526 |
+
base.buttonNext.removeClass("disabled");
|
527 |
+
}
|
528 |
+
}
|
529 |
+
},
|
530 |
+
|
531 |
+
updateControls : function () {
|
532 |
+
var base = this;
|
533 |
+
base.updatePagination();
|
534 |
+
base.checkNavigation();
|
535 |
+
if (base.owlControls) {
|
536 |
+
if (base.options.items >= base.itemsAmount) {
|
537 |
+
base.owlControls.hide();
|
538 |
+
} else {
|
539 |
+
base.owlControls.show();
|
540 |
+
}
|
541 |
+
}
|
542 |
+
},
|
543 |
+
|
544 |
+
destroyControls : function () {
|
545 |
+
var base = this;
|
546 |
+
if (base.owlControls) {
|
547 |
+
base.owlControls.remove();
|
548 |
+
}
|
549 |
+
},
|
550 |
+
|
551 |
+
next : function (speed) {
|
552 |
+
var base = this;
|
553 |
+
|
554 |
+
if (base.isTransition) {
|
555 |
+
return false;
|
556 |
+
}
|
557 |
+
|
558 |
+
base.currentItem += base.options.scrollPerPage === true ? base.options.items : 1;
|
559 |
+
if (base.currentItem > base.maximumItem + (base.options.scrollPerPage === true ? (base.options.items - 1) : 0)) {
|
560 |
+
if (base.options.rewindNav === true) {
|
561 |
+
base.currentItem = 0;
|
562 |
+
speed = "rewind";
|
563 |
+
} else {
|
564 |
+
base.currentItem = base.maximumItem;
|
565 |
+
return false;
|
566 |
+
}
|
567 |
+
}
|
568 |
+
base.goTo(base.currentItem, speed);
|
569 |
+
},
|
570 |
+
|
571 |
+
prev : function (speed) {
|
572 |
+
var base = this;
|
573 |
+
|
574 |
+
if (base.isTransition) {
|
575 |
+
return false;
|
576 |
+
}
|
577 |
+
|
578 |
+
if (base.options.scrollPerPage === true && base.currentItem > 0 && base.currentItem < base.options.items) {
|
579 |
+
base.currentItem = 0;
|
580 |
+
} else {
|
581 |
+
base.currentItem -= base.options.scrollPerPage === true ? base.options.items : 1;
|
582 |
+
}
|
583 |
+
if (base.currentItem < 0) {
|
584 |
+
if (base.options.rewindNav === true) {
|
585 |
+
base.currentItem = base.maximumItem;
|
586 |
+
speed = "rewind";
|
587 |
+
} else {
|
588 |
+
base.currentItem = 0;
|
589 |
+
return false;
|
590 |
+
}
|
591 |
+
}
|
592 |
+
base.goTo(base.currentItem, speed);
|
593 |
+
},
|
594 |
+
|
595 |
+
goTo : function (position, speed, drag) {
|
596 |
+
var base = this,
|
597 |
+
goToPixel;
|
598 |
+
|
599 |
+
if (base.isTransition) {
|
600 |
+
return false;
|
601 |
+
}
|
602 |
+
if (typeof base.options.beforeMove === "function") {
|
603 |
+
base.options.beforeMove.apply(this, [base.$elem]);
|
604 |
+
}
|
605 |
+
if (position >= base.maximumItem) {
|
606 |
+
position = base.maximumItem;
|
607 |
+
} else if (position <= 0) {
|
608 |
+
position = 0;
|
609 |
+
}
|
610 |
+
|
611 |
+
base.currentItem = base.owl.currentItem = position;
|
612 |
+
if (base.options.transitionStyle !== false && drag !== "drag" && base.options.items === 1 && base.browser.support3d === true) {
|
613 |
+
base.swapSpeed(0);
|
614 |
+
if (base.browser.support3d === true) {
|
615 |
+
base.transition3d(base.positionsInArray[position]);
|
616 |
+
} else {
|
617 |
+
base.css2slide(base.positionsInArray[position], 1);
|
618 |
+
}
|
619 |
+
base.afterGo();
|
620 |
+
base.singleItemTransition();
|
621 |
+
return false;
|
622 |
+
}
|
623 |
+
goToPixel = base.positionsInArray[position];
|
624 |
+
|
625 |
+
if (base.browser.support3d === true) {
|
626 |
+
base.isCss3Finish = false;
|
627 |
+
|
628 |
+
if (speed === true) {
|
629 |
+
base.swapSpeed("paginationSpeed");
|
630 |
+
window.setTimeout(function () {
|
631 |
+
base.isCss3Finish = true;
|
632 |
+
}, base.options.paginationSpeed);
|
633 |
+
|
634 |
+
} else if (speed === "rewind") {
|
635 |
+
base.swapSpeed(base.options.rewindSpeed);
|
636 |
+
window.setTimeout(function () {
|
637 |
+
base.isCss3Finish = true;
|
638 |
+
}, base.options.rewindSpeed);
|
639 |
+
|
640 |
+
} else {
|
641 |
+
base.swapSpeed("slideSpeed");
|
642 |
+
window.setTimeout(function () {
|
643 |
+
base.isCss3Finish = true;
|
644 |
+
}, base.options.slideSpeed);
|
645 |
+
}
|
646 |
+
base.transition3d(goToPixel);
|
647 |
+
} else {
|
648 |
+
if (speed === true) {
|
649 |
+
base.css2slide(goToPixel, base.options.paginationSpeed);
|
650 |
+
} else if (speed === "rewind") {
|
651 |
+
base.css2slide(goToPixel, base.options.rewindSpeed);
|
652 |
+
} else {
|
653 |
+
base.css2slide(goToPixel, base.options.slideSpeed);
|
654 |
+
}
|
655 |
+
}
|
656 |
+
base.afterGo();
|
657 |
+
},
|
658 |
+
|
659 |
+
jumpTo : function (position) {
|
660 |
+
var base = this;
|
661 |
+
if (typeof base.options.beforeMove === "function") {
|
662 |
+
base.options.beforeMove.apply(this, [base.$elem]);
|
663 |
+
}
|
664 |
+
if (position >= base.maximumItem || position === -1) {
|
665 |
+
position = base.maximumItem;
|
666 |
+
} else if (position <= 0) {
|
667 |
+
position = 0;
|
668 |
+
}
|
669 |
+
base.swapSpeed(0);
|
670 |
+
if (base.browser.support3d === true) {
|
671 |
+
base.transition3d(base.positionsInArray[position]);
|
672 |
+
} else {
|
673 |
+
base.css2slide(base.positionsInArray[position], 1);
|
674 |
+
}
|
675 |
+
base.currentItem = base.owl.currentItem = position;
|
676 |
+
base.afterGo();
|
677 |
+
},
|
678 |
+
|
679 |
+
afterGo : function () {
|
680 |
+
var base = this;
|
681 |
+
|
682 |
+
base.prevArr.push(base.currentItem);
|
683 |
+
base.prevItem = base.owl.prevItem = base.prevArr[base.prevArr.length - 2];
|
684 |
+
base.prevArr.shift(0);
|
685 |
+
|
686 |
+
if (base.prevItem !== base.currentItem) {
|
687 |
+
base.checkPagination();
|
688 |
+
base.checkNavigation();
|
689 |
+
base.eachMoveUpdate();
|
690 |
+
|
691 |
+
if (base.options.autoPlay !== false) {
|
692 |
+
base.checkAp();
|
693 |
+
}
|
694 |
+
}
|
695 |
+
if (typeof base.options.afterMove === "function" && base.prevItem !== base.currentItem) {
|
696 |
+
base.options.afterMove.apply(this, [base.$elem]);
|
697 |
+
}
|
698 |
+
},
|
699 |
+
|
700 |
+
stop : function () {
|
701 |
+
var base = this;
|
702 |
+
base.apStatus = "stop";
|
703 |
+
window.clearInterval(base.autoPlayInterval);
|
704 |
+
},
|
705 |
+
|
706 |
+
checkAp : function () {
|
707 |
+
var base = this;
|
708 |
+
if (base.apStatus !== "stop") {
|
709 |
+
base.play();
|
710 |
+
}
|
711 |
+
},
|
712 |
+
|
713 |
+
play : function () {
|
714 |
+
var base = this;
|
715 |
+
base.apStatus = "play";
|
716 |
+
if (base.options.autoPlay === false) {
|
717 |
+
return false;
|
718 |
+
}
|
719 |
+
window.clearInterval(base.autoPlayInterval);
|
720 |
+
base.autoPlayInterval = window.setInterval(function () {
|
721 |
+
base.next(true);
|
722 |
+
}, base.options.autoPlay);
|
723 |
+
},
|
724 |
+
|
725 |
+
swapSpeed : function (action) {
|
726 |
+
var base = this;
|
727 |
+
if (action === "slideSpeed") {
|
728 |
+
base.$owlWrapper.css(base.addCssSpeed(base.options.slideSpeed));
|
729 |
+
} else if (action === "paginationSpeed") {
|
730 |
+
base.$owlWrapper.css(base.addCssSpeed(base.options.paginationSpeed));
|
731 |
+
} else if (typeof action !== "string") {
|
732 |
+
base.$owlWrapper.css(base.addCssSpeed(action));
|
733 |
+
}
|
734 |
+
},
|
735 |
+
|
736 |
+
addCssSpeed : function (speed) {
|
737 |
+
return {
|
738 |
+
"-webkit-transition": "all " + speed + "ms ease",
|
739 |
+
"-moz-transition": "all " + speed + "ms ease",
|
740 |
+
"-o-transition": "all " + speed + "ms ease",
|
741 |
+
"transition": "all " + speed + "ms ease"
|
742 |
+
};
|
743 |
+
},
|
744 |
+
|
745 |
+
removeTransition : function () {
|
746 |
+
return {
|
747 |
+
"-webkit-transition": "",
|
748 |
+
"-moz-transition": "",
|
749 |
+
"-o-transition": "",
|
750 |
+
"transition": ""
|
751 |
+
};
|
752 |
+
},
|
753 |
+
|
754 |
+
doTranslate : function (pixels) {
|
755 |
+
return {
|
756 |
+
"-webkit-transform": "translate3d(" + pixels + "px, 0px, 0px)",
|
757 |
+
"-moz-transform": "translate3d(" + pixels + "px, 0px, 0px)",
|
758 |
+
"-o-transform": "translate3d(" + pixels + "px, 0px, 0px)",
|
759 |
+
"-ms-transform": "translate3d(" + pixels + "px, 0px, 0px)",
|
760 |
+
"transform": "translate3d(" + pixels + "px, 0px,0px)"
|
761 |
+
};
|
762 |
+
},
|
763 |
+
|
764 |
+
transition3d : function (value) {
|
765 |
+
var base = this;
|
766 |
+
base.$owlWrapper.css(base.doTranslate(value));
|
767 |
+
},
|
768 |
+
|
769 |
+
css2move : function (value) {
|
770 |
+
var base = this;
|
771 |
+
base.$owlWrapper.css({"left" : value});
|
772 |
+
},
|
773 |
+
|
774 |
+
css2slide : function (value, speed) {
|
775 |
+
var base = this;
|
776 |
+
|
777 |
+
base.isCssFinish = false;
|
778 |
+
base.$owlWrapper.stop(true, true).animate({
|
779 |
+
"left" : value
|
780 |
+
}, {
|
781 |
+
duration : speed || base.options.slideSpeed,
|
782 |
+
complete : function () {
|
783 |
+
base.isCssFinish = true;
|
784 |
+
}
|
785 |
+
});
|
786 |
+
},
|
787 |
+
|
788 |
+
checkBrowser : function () {
|
789 |
+
var base = this,
|
790 |
+
translate3D = "translate3d(0px, 0px, 0px)",
|
791 |
+
tempElem = document.createElement("div"),
|
792 |
+
regex,
|
793 |
+
asSupport,
|
794 |
+
support3d,
|
795 |
+
isTouch;
|
796 |
+
|
797 |
+
tempElem.style.cssText = " -moz-transform:" + translate3D +
|
798 |
+
"; -ms-transform:" + translate3D +
|
799 |
+
"; -o-transform:" + translate3D +
|
800 |
+
"; -webkit-transform:" + translate3D +
|
801 |
+
"; transform:" + translate3D;
|
802 |
+
regex = /translate3d\(0px, 0px, 0px\)/g;
|
803 |
+
asSupport = tempElem.style.cssText.match(regex);
|
804 |
+
support3d = (asSupport !== null && asSupport.length === 1);
|
805 |
+
|
806 |
+
isTouch = "ontouchstart" in window || window.navigator.msMaxTouchPoints;
|
807 |
+
|
808 |
+
base.browser = {
|
809 |
+
"support3d" : support3d,
|
810 |
+
"isTouch" : isTouch
|
811 |
+
};
|
812 |
+
},
|
813 |
+
|
814 |
+
moveEvents : function () {
|
815 |
+
var base = this;
|
816 |
+
if (base.options.mouseDrag !== false || base.options.touchDrag !== false) {
|
817 |
+
base.gestures();
|
818 |
+
base.disabledEvents();
|
819 |
+
}
|
820 |
+
},
|
821 |
+
|
822 |
+
eventTypes : function () {
|
823 |
+
var base = this,
|
824 |
+
types = ["s", "e", "x"];
|
825 |
+
|
826 |
+
base.ev_types = {};
|
827 |
+
|
828 |
+
if (base.options.mouseDrag === true && base.options.touchDrag === true) {
|
829 |
+
types = [
|
830 |
+
"touchstart.owl mousedown.owl",
|
831 |
+
"touchmove.owl mousemove.owl",
|
832 |
+
"touchend.owl touchcancel.owl mouseup.owl"
|
833 |
+
];
|
834 |
+
} else if (base.options.mouseDrag === false && base.options.touchDrag === true) {
|
835 |
+
types = [
|
836 |
+
"touchstart.owl",
|
837 |
+
"touchmove.owl",
|
838 |
+
"touchend.owl touchcancel.owl"
|
839 |
+
];
|
840 |
+
} else if (base.options.mouseDrag === true && base.options.touchDrag === false) {
|
841 |
+
types = [
|
842 |
+
"mousedown.owl",
|
843 |
+
"mousemove.owl",
|
844 |
+
"mouseup.owl"
|
845 |
+
];
|
846 |
+
}
|
847 |
+
|
848 |
+
base.ev_types.start = types[0];
|
849 |
+
base.ev_types.move = types[1];
|
850 |
+
base.ev_types.end = types[2];
|
851 |
+
},
|
852 |
+
|
853 |
+
disabledEvents : function () {
|
854 |
+
var base = this;
|
855 |
+
base.$elem.on("dragstart.owl", function (event) { event.preventDefault(); });
|
856 |
+
base.$elem.on("mousedown.disableTextSelect", function (e) {
|
857 |
+
return $(e.target).is('input, textarea, select, option');
|
858 |
+
});
|
859 |
+
},
|
860 |
+
|
861 |
+
gestures : function () {
|
862 |
+
/*jslint unparam: true*/
|
863 |
+
var base = this,
|
864 |
+
locals = {
|
865 |
+
offsetX : 0,
|
866 |
+
offsetY : 0,
|
867 |
+
baseElWidth : 0,
|
868 |
+
relativePos : 0,
|
869 |
+
position: null,
|
870 |
+
minSwipe : null,
|
871 |
+
maxSwipe: null,
|
872 |
+
sliding : null,
|
873 |
+
dargging: null,
|
874 |
+
targetElement : null
|
875 |
+
};
|
876 |
+
|
877 |
+
base.isCssFinish = true;
|
878 |
+
|
879 |
+
function getTouches(event) {
|
880 |
+
if (event.touches !== undefined) {
|
881 |
+
return {
|
882 |
+
x : event.touches[0].pageX,
|
883 |
+
y : event.touches[0].pageY
|
884 |
+
};
|
885 |
+
}
|
886 |
+
|
887 |
+
if (event.touches === undefined) {
|
888 |
+
if (event.pageX !== undefined) {
|
889 |
+
return {
|
890 |
+
x : event.pageX,
|
891 |
+
y : event.pageY
|
892 |
+
};
|
893 |
+
}
|
894 |
+
if (event.pageX === undefined) {
|
895 |
+
return {
|
896 |
+
x : event.clientX,
|
897 |
+
y : event.clientY
|
898 |
+
};
|
899 |
+
}
|
900 |
+
}
|
901 |
+
}
|
902 |
+
|
903 |
+
function swapEvents(type) {
|
904 |
+
if (type === "on") {
|
905 |
+
$(document).on(base.ev_types.move, dragMove);
|
906 |
+
$(document).on(base.ev_types.end, dragEnd);
|
907 |
+
} else if (type === "off") {
|
908 |
+
$(document).off(base.ev_types.move);
|
909 |
+
$(document).off(base.ev_types.end);
|
910 |
+
}
|
911 |
+
}
|
912 |
+
|
913 |
+
function dragStart(event) {
|
914 |
+
var ev = event.originalEvent || event || window.event,
|
915 |
+
position;
|
916 |
+
|
917 |
+
if (ev.which === 3) {
|
918 |
+
return false;
|
919 |
+
}
|
920 |
+
if (base.itemsAmount <= base.options.items) {
|
921 |
+
return;
|
922 |
+
}
|
923 |
+
if (base.isCssFinish === false && !base.options.dragBeforeAnimFinish) {
|
924 |
+
return false;
|
925 |
+
}
|
926 |
+
if (base.isCss3Finish === false && !base.options.dragBeforeAnimFinish) {
|
927 |
+
return false;
|
928 |
+
}
|
929 |
+
|
930 |
+
if (base.options.autoPlay !== false) {
|
931 |
+
window.clearInterval(base.autoPlayInterval);
|
932 |
+
}
|
933 |
+
|
934 |
+
if (base.browser.isTouch !== true && !base.$owlWrapper.hasClass("grabbing")) {
|
935 |
+
base.$owlWrapper.addClass("grabbing");
|
936 |
+
}
|
937 |
+
|
938 |
+
base.newPosX = 0;
|
939 |
+
base.newRelativeX = 0;
|
940 |
+
|
941 |
+
$(this).css(base.removeTransition());
|
942 |
+
|
943 |
+
position = $(this).position();
|
944 |
+
locals.relativePos = position.left;
|
945 |
+
|
946 |
+
locals.offsetX = getTouches(ev).x - position.left;
|
947 |
+
locals.offsetY = getTouches(ev).y - position.top;
|
948 |
+
|
949 |
+
swapEvents("on");
|
950 |
+
|
951 |
+
locals.sliding = false;
|
952 |
+
locals.targetElement = ev.target || ev.srcElement;
|
953 |
+
}
|
954 |
+
|
955 |
+
function dragMove(event) {
|
956 |
+
var ev = event.originalEvent || event || window.event,
|
957 |
+
minSwipe,
|
958 |
+
maxSwipe;
|
959 |
+
|
960 |
+
base.newPosX = getTouches(ev).x - locals.offsetX;
|
961 |
+
base.newPosY = getTouches(ev).y - locals.offsetY;
|
962 |
+
base.newRelativeX = base.newPosX - locals.relativePos;
|
963 |
+
|
964 |
+
if (typeof base.options.startDragging === "function" && locals.dragging !== true && base.newRelativeX !== 0) {
|
965 |
+
locals.dragging = true;
|
966 |
+
base.options.startDragging.apply(base, [base.$elem]);
|
967 |
+
}
|
968 |
+
|
969 |
+
if ((base.newRelativeX > 8 || base.newRelativeX < -8) && (base.browser.isTouch === true)) {
|
970 |
+
if (ev.preventDefault !== undefined) {
|
971 |
+
ev.preventDefault();
|
972 |
+
} else {
|
973 |
+
ev.returnValue = false;
|
974 |
+
}
|
975 |
+
locals.sliding = true;
|
976 |
+
}
|
977 |
+
|
978 |
+
if ((base.newPosY > 10 || base.newPosY < -10) && locals.sliding === false) {
|
979 |
+
$(document).off("touchmove.owl");
|
980 |
+
}
|
981 |
+
|
982 |
+
minSwipe = function () {
|
983 |
+
return base.newRelativeX / 5;
|
984 |
+
};
|
985 |
+
|
986 |
+
maxSwipe = function () {
|
987 |
+
return base.maximumPixels + base.newRelativeX / 5;
|
988 |
+
};
|
989 |
+
|
990 |
+
base.newPosX = Math.max(Math.min(base.newPosX, minSwipe()), maxSwipe());
|
991 |
+
if (base.browser.support3d === true) {
|
992 |
+
base.transition3d(base.newPosX);
|
993 |
+
} else {
|
994 |
+
base.css2move(base.newPosX);
|
995 |
+
}
|
996 |
+
}
|
997 |
+
|
998 |
+
function dragEnd(event) {
|
999 |
+
var ev = event.originalEvent || event || window.event,
|
1000 |
+
newPosition,
|
1001 |
+
handlers,
|
1002 |
+
owlStopEvent;
|
1003 |
+
|
1004 |
+
ev.target = ev.target || ev.srcElement;
|
1005 |
+
|
1006 |
+
locals.dragging = false;
|
1007 |
+
|
1008 |
+
if (base.browser.isTouch !== true) {
|
1009 |
+
base.$owlWrapper.removeClass("grabbing");
|
1010 |
+
}
|
1011 |
+
|
1012 |
+
if (base.newRelativeX < 0) {
|
1013 |
+
base.dragDirection = base.owl.dragDirection = "left";
|
1014 |
+
} else {
|
1015 |
+
base.dragDirection = base.owl.dragDirection = "right";
|
1016 |
+
}
|
1017 |
+
|
1018 |
+
if (base.newRelativeX !== 0) {
|
1019 |
+
newPosition = base.getNewPosition();
|
1020 |
+
base.goTo(newPosition, false, "drag");
|
1021 |
+
if (locals.targetElement === ev.target && base.browser.isTouch !== true) {
|
1022 |
+
$(ev.target).on("click.disable", function (ev) {
|
1023 |
+
ev.stopImmediatePropagation();
|
1024 |
+
ev.stopPropagation();
|
1025 |
+
ev.preventDefault();
|
1026 |
+
$(ev.target).off("click.disable");
|
1027 |
+
});
|
1028 |
+
handlers = $._data(ev.target, "events").click;
|
1029 |
+
owlStopEvent = handlers.pop();
|
1030 |
+
handlers.splice(0, 0, owlStopEvent);
|
1031 |
+
}
|
1032 |
+
}
|
1033 |
+
swapEvents("off");
|
1034 |
+
}
|
1035 |
+
base.$elem.on(base.ev_types.start, ".owl-wrapper", dragStart);
|
1036 |
+
},
|
1037 |
+
|
1038 |
+
getNewPosition : function () {
|
1039 |
+
var base = this,
|
1040 |
+
newPosition = base.closestItem();
|
1041 |
+
|
1042 |
+
if (newPosition > base.maximumItem) {
|
1043 |
+
base.currentItem = base.maximumItem;
|
1044 |
+
newPosition = base.maximumItem;
|
1045 |
+
} else if (base.newPosX >= 0) {
|
1046 |
+
newPosition = 0;
|
1047 |
+
base.currentItem = 0;
|
1048 |
+
}
|
1049 |
+
return newPosition;
|
1050 |
+
},
|
1051 |
+
closestItem : function () {
|
1052 |
+
var base = this,
|
1053 |
+
array = base.options.scrollPerPage === true ? base.pagesInArray : base.positionsInArray,
|
1054 |
+
goal = base.newPosX,
|
1055 |
+
closest = null;
|
1056 |
+
|
1057 |
+
$.each(array, function (i, v) {
|
1058 |
+
if (goal - (base.itemWidth / 20) > array[i + 1] && goal - (base.itemWidth / 20) < v && base.moveDirection() === "left") {
|
1059 |
+
closest = v;
|
1060 |
+
if (base.options.scrollPerPage === true) {
|
1061 |
+
base.currentItem = $.inArray(closest, base.positionsInArray);
|
1062 |
+
} else {
|
1063 |
+
base.currentItem = i;
|
1064 |
+
}
|
1065 |
+
} else if (goal + (base.itemWidth / 20) < v && goal + (base.itemWidth / 20) > (array[i + 1] || array[i] - base.itemWidth) && base.moveDirection() === "right") {
|
1066 |
+
if (base.options.scrollPerPage === true) {
|
1067 |
+
closest = array[i + 1] || array[array.length - 1];
|
1068 |
+
base.currentItem = $.inArray(closest, base.positionsInArray);
|
1069 |
+
} else {
|
1070 |
+
closest = array[i + 1];
|
1071 |
+
base.currentItem = i + 1;
|
1072 |
+
}
|
1073 |
+
}
|
1074 |
+
});
|
1075 |
+
return base.currentItem;
|
1076 |
+
},
|
1077 |
+
|
1078 |
+
moveDirection : function () {
|
1079 |
+
var base = this,
|
1080 |
+
direction;
|
1081 |
+
if (base.newRelativeX < 0) {
|
1082 |
+
direction = "right";
|
1083 |
+
base.playDirection = "next";
|
1084 |
+
} else {
|
1085 |
+
direction = "left";
|
1086 |
+
base.playDirection = "prev";
|
1087 |
+
}
|
1088 |
+
return direction;
|
1089 |
+
},
|
1090 |
+
|
1091 |
+
customEvents : function () {
|
1092 |
+
/*jslint unparam: true*/
|
1093 |
+
var base = this;
|
1094 |
+
base.$elem.on("owl.next", function () {
|
1095 |
+
base.next();
|
1096 |
+
});
|
1097 |
+
base.$elem.on("owl.prev", function () {
|
1098 |
+
base.prev();
|
1099 |
+
});
|
1100 |
+
base.$elem.on("owl.play", function (event, speed) {
|
1101 |
+
base.options.autoPlay = speed;
|
1102 |
+
base.play();
|
1103 |
+
base.hoverStatus = "play";
|
1104 |
+
});
|
1105 |
+
base.$elem.on("owl.stop", function () {
|
1106 |
+
base.stop();
|
1107 |
+
base.hoverStatus = "stop";
|
1108 |
+
});
|
1109 |
+
base.$elem.on("owl.goTo", function (event, item) {
|
1110 |
+
base.goTo(item);
|
1111 |
+
});
|
1112 |
+
base.$elem.on("owl.jumpTo", function (event, item) {
|
1113 |
+
base.jumpTo(item);
|
1114 |
+
});
|
1115 |
+
},
|
1116 |
+
|
1117 |
+
stopOnHover : function () {
|
1118 |
+
var base = this;
|
1119 |
+
if (base.options.stopOnHover === true && base.browser.isTouch !== true && base.options.autoPlay !== false) {
|
1120 |
+
base.$elem.on("mouseover", function () {
|
1121 |
+
base.stop();
|
1122 |
+
});
|
1123 |
+
base.$elem.on("mouseout", function () {
|
1124 |
+
if (base.hoverStatus !== "stop") {
|
1125 |
+
base.play();
|
1126 |
+
}
|
1127 |
+
});
|
1128 |
+
}
|
1129 |
+
},
|
1130 |
+
|
1131 |
+
lazyLoad : function () {
|
1132 |
+
var base = this,
|
1133 |
+
i,
|
1134 |
+
$item,
|
1135 |
+
itemNumber,
|
1136 |
+
$lazyImg,
|
1137 |
+
follow;
|
1138 |
+
|
1139 |
+
if (base.options.lazyLoad === false) {
|
1140 |
+
return false;
|
1141 |
+
}
|
1142 |
+
for (i = 0; i < base.itemsAmount; i += 1) {
|
1143 |
+
$item = $(base.$owlItems[i]);
|
1144 |
+
|
1145 |
+
if ($item.data("owl-loaded") === "loaded") {
|
1146 |
+
continue;
|
1147 |
+
}
|
1148 |
+
|
1149 |
+
itemNumber = $item.data("owl-item");
|
1150 |
+
$lazyImg = $item.find(".lazyOwl");
|
1151 |
+
|
1152 |
+
if (typeof $lazyImg.data("src") !== "string") {
|
1153 |
+
$item.data("owl-loaded", "loaded");
|
1154 |
+
continue;
|
1155 |
+
}
|
1156 |
+
if ($item.data("owl-loaded") === undefined) {
|
1157 |
+
$lazyImg.hide();
|
1158 |
+
$item.addClass("loading").data("owl-loaded", "checked");
|
1159 |
+
}
|
1160 |
+
if (base.options.lazyFollow === true) {
|
1161 |
+
follow = itemNumber >= base.currentItem;
|
1162 |
+
} else {
|
1163 |
+
follow = true;
|
1164 |
+
}
|
1165 |
+
if (follow && itemNumber < base.currentItem + base.options.items && $lazyImg.length) {
|
1166 |
+
base.lazyPreload($item, $lazyImg);
|
1167 |
+
}
|
1168 |
+
}
|
1169 |
+
},
|
1170 |
+
|
1171 |
+
lazyPreload : function ($item, $lazyImg) {
|
1172 |
+
var base = this,
|
1173 |
+
iterations = 0,
|
1174 |
+
isBackgroundImg;
|
1175 |
+
|
1176 |
+
if ($lazyImg.prop("tagName") === "DIV") {
|
1177 |
+
$lazyImg.css("background-image", "url(" + $lazyImg.data("src") + ")");
|
1178 |
+
isBackgroundImg = true;
|
1179 |
+
} else {
|
1180 |
+
$lazyImg[0].src = $lazyImg.data("src");
|
1181 |
+
}
|
1182 |
+
|
1183 |
+
function showImage() {
|
1184 |
+
$item.data("owl-loaded", "loaded").removeClass("loading");
|
1185 |
+
$lazyImg.removeAttr("data-src");
|
1186 |
+
if (base.options.lazyEffect === "fade") {
|
1187 |
+
$lazyImg.fadeIn(400);
|
1188 |
+
} else {
|
1189 |
+
$lazyImg.show();
|
1190 |
+
}
|
1191 |
+
if (typeof base.options.afterLazyLoad === "function") {
|
1192 |
+
base.options.afterLazyLoad.apply(this, [base.$elem]);
|
1193 |
+
}
|
1194 |
+
}
|
1195 |
+
|
1196 |
+
function checkLazyImage() {
|
1197 |
+
iterations += 1;
|
1198 |
+
if (base.completeImg($lazyImg.get(0)) || isBackgroundImg === true) {
|
1199 |
+
showImage();
|
1200 |
+
} else if (iterations <= 100) {//if image loads in less than 10 seconds
|
1201 |
+
window.setTimeout(checkLazyImage, 100);
|
1202 |
+
} else {
|
1203 |
+
showImage();
|
1204 |
+
}
|
1205 |
+
}
|
1206 |
+
|
1207 |
+
checkLazyImage();
|
1208 |
+
},
|
1209 |
+
|
1210 |
+
autoHeight : function () {
|
1211 |
+
var base = this,
|
1212 |
+
$currentimg = $(base.$owlItems[base.currentItem]).find("img"),
|
1213 |
+
iterations;
|
1214 |
+
|
1215 |
+
function addHeight() {
|
1216 |
+
var $currentItem = $(base.$owlItems[base.currentItem]).height();
|
1217 |
+
base.wrapperOuter.css("height", $currentItem + "px");
|
1218 |
+
if (!base.wrapperOuter.hasClass("autoHeight")) {
|
1219 |
+
window.setTimeout(function () {
|
1220 |
+
base.wrapperOuter.addClass("autoHeight");
|
1221 |
+
}, 0);
|
1222 |
+
}
|
1223 |
+
}
|
1224 |
+
|
1225 |
+
function checkImage() {
|
1226 |
+
iterations += 1;
|
1227 |
+
if (base.completeImg($currentimg.get(0))) {
|
1228 |
+
addHeight();
|
1229 |
+
} else if (iterations <= 100) { //if image loads in less than 10 seconds
|
1230 |
+
window.setTimeout(checkImage, 100);
|
1231 |
+
} else {
|
1232 |
+
base.wrapperOuter.css("height", ""); //Else remove height attribute
|
1233 |
+
}
|
1234 |
+
}
|
1235 |
+
|
1236 |
+
if ($currentimg.get(0) !== undefined) {
|
1237 |
+
iterations = 0;
|
1238 |
+
checkImage();
|
1239 |
+
} else {
|
1240 |
+
addHeight();
|
1241 |
+
}
|
1242 |
+
},
|
1243 |
+
|
1244 |
+
completeImg : function (img) {
|
1245 |
+
var naturalWidthType;
|
1246 |
+
|
1247 |
+
if (!img.complete) {
|
1248 |
+
return false;
|
1249 |
+
}
|
1250 |
+
naturalWidthType = typeof img.naturalWidth;
|
1251 |
+
if (naturalWidthType !== "undefined" && img.naturalWidth === 0) {
|
1252 |
+
return false;
|
1253 |
+
}
|
1254 |
+
return true;
|
1255 |
+
},
|
1256 |
+
|
1257 |
+
onVisibleItems : function () {
|
1258 |
+
var base = this,
|
1259 |
+
i;
|
1260 |
+
|
1261 |
+
if (base.options.addClassActive === true) {
|
1262 |
+
base.$owlItems.removeClass("active");
|
1263 |
+
}
|
1264 |
+
base.visibleItems = [];
|
1265 |
+
for (i = base.currentItem; i < base.currentItem + base.options.items; i += 1) {
|
1266 |
+
base.visibleItems.push(i);
|
1267 |
+
|
1268 |
+
if (base.options.addClassActive === true) {
|
1269 |
+
$(base.$owlItems[i]).addClass("active");
|
1270 |
+
}
|
1271 |
+
}
|
1272 |
+
base.owl.visibleItems = base.visibleItems;
|
1273 |
+
},
|
1274 |
+
|
1275 |
+
transitionTypes : function (className) {
|
1276 |
+
var base = this;
|
1277 |
+
//Currently available: "fade", "backSlide", "goDown", "fadeUp"
|
1278 |
+
base.outClass = "owl-" + className + "-out";
|
1279 |
+
base.inClass = "owl-" + className + "-in";
|
1280 |
+
},
|
1281 |
+
|
1282 |
+
singleItemTransition : function () {
|
1283 |
+
var base = this,
|
1284 |
+
outClass = base.outClass,
|
1285 |
+
inClass = base.inClass,
|
1286 |
+
$currentItem = base.$owlItems.eq(base.currentItem),
|
1287 |
+
$prevItem = base.$owlItems.eq(base.prevItem),
|
1288 |
+
prevPos = Math.abs(base.positionsInArray[base.currentItem]) + base.positionsInArray[base.prevItem],
|
1289 |
+
origin = Math.abs(base.positionsInArray[base.currentItem]) + base.itemWidth / 2,
|
1290 |
+
animEnd = 'webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend';
|
1291 |
+
|
1292 |
+
base.isTransition = true;
|
1293 |
+
|
1294 |
+
base.$owlWrapper
|
1295 |
+
.addClass('owl-origin')
|
1296 |
+
.css({
|
1297 |
+
"-webkit-transform-origin" : origin + "px",
|
1298 |
+
"-moz-perspective-origin" : origin + "px",
|
1299 |
+
"perspective-origin" : origin + "px"
|
1300 |
+
});
|
1301 |
+
function transStyles(prevPos) {
|
1302 |
+
return {
|
1303 |
+
"position" : "relative",
|
1304 |
+
"left" : prevPos + "px"
|
1305 |
+
};
|
1306 |
+
}
|
1307 |
+
|
1308 |
+
$prevItem
|
1309 |
+
.css(transStyles(prevPos, 10))
|
1310 |
+
.addClass(outClass)
|
1311 |
+
.on(animEnd, function () {
|
1312 |
+
base.endPrev = true;
|
1313 |
+
$prevItem.off(animEnd);
|
1314 |
+
base.clearTransStyle($prevItem, outClass);
|
1315 |
+
});
|
1316 |
+
|
1317 |
+
$currentItem
|
1318 |
+
.addClass(inClass)
|
1319 |
+
.on(animEnd, function () {
|
1320 |
+
base.endCurrent = true;
|
1321 |
+
$currentItem.off(animEnd);
|
1322 |
+
base.clearTransStyle($currentItem, inClass);
|
1323 |
+
});
|
1324 |
+
},
|
1325 |
+
|
1326 |
+
clearTransStyle : function (item, classToRemove) {
|
1327 |
+
var base = this;
|
1328 |
+
item.css({
|
1329 |
+
"position" : "",
|
1330 |
+
"left" : ""
|
1331 |
+
}).removeClass(classToRemove);
|
1332 |
+
|
1333 |
+
if (base.endPrev && base.endCurrent) {
|
1334 |
+
base.$owlWrapper.removeClass('owl-origin');
|
1335 |
+
base.endPrev = false;
|
1336 |
+
base.endCurrent = false;
|
1337 |
+
base.isTransition = false;
|
1338 |
+
}
|
1339 |
+
},
|
1340 |
+
|
1341 |
+
owlStatus : function () {
|
1342 |
+
var base = this;
|
1343 |
+
base.owl = {
|
1344 |
+
"userOptions" : base.userOptions,
|
1345 |
+
"baseElement" : base.$elem,
|
1346 |
+
"userItems" : base.$userItems,
|
1347 |
+
"owlItems" : base.$owlItems,
|
1348 |
+
"currentItem" : base.currentItem,
|
1349 |
+
"prevItem" : base.prevItem,
|
1350 |
+
"visibleItems" : base.visibleItems,
|
1351 |
+
"isTouch" : base.browser.isTouch,
|
1352 |
+
"browser" : base.browser,
|
1353 |
+
"dragDirection" : base.dragDirection
|
1354 |
+
};
|
1355 |
+
},
|
1356 |
+
|
1357 |
+
clearEvents : function () {
|
1358 |
+
var base = this;
|
1359 |
+
base.$elem.off(".owl owl mousedown.disableTextSelect");
|
1360 |
+
$(document).off(".owl owl");
|
1361 |
+
$(window).off("resize", base.resizer);
|
1362 |
+
},
|
1363 |
+
|
1364 |
+
unWrap : function () {
|
1365 |
+
var base = this;
|
1366 |
+
if (base.$elem.children().length !== 0) {
|
1367 |
+
base.$owlWrapper.unwrap();
|
1368 |
+
base.$userItems.unwrap().unwrap();
|
1369 |
+
if (base.owlControls) {
|
1370 |
+
base.owlControls.remove();
|
1371 |
+
}
|
1372 |
+
}
|
1373 |
+
base.clearEvents();
|
1374 |
+
base.$elem
|
1375 |
+
.attr("style", base.$elem.data("owl-originalStyles") || "")
|
1376 |
+
.attr("class", base.$elem.data("owl-originalClasses"));
|
1377 |
+
},
|
1378 |
+
|
1379 |
+
destroy : function () {
|
1380 |
+
var base = this;
|
1381 |
+
base.stop();
|
1382 |
+
window.clearInterval(base.checkVisible);
|
1383 |
+
base.unWrap();
|
1384 |
+
base.$elem.removeData();
|
1385 |
+
},
|
1386 |
+
|
1387 |
+
reinit : function (newOptions) {
|
1388 |
+
var base = this,
|
1389 |
+
options = $.extend({}, base.userOptions, newOptions);
|
1390 |
+
base.unWrap();
|
1391 |
+
base.init(options, base.$elem);
|
1392 |
+
},
|
1393 |
+
|
1394 |
+
addItem : function (htmlString, targetPosition) {
|
1395 |
+
var base = this,
|
1396 |
+
position;
|
1397 |
+
|
1398 |
+
if (!htmlString) {return false; }
|
1399 |
+
|
1400 |
+
if (base.$elem.children().length === 0) {
|
1401 |
+
base.$elem.append(htmlString);
|
1402 |
+
base.setVars();
|
1403 |
+
return false;
|
1404 |
+
}
|
1405 |
+
base.unWrap();
|
1406 |
+
if (targetPosition === undefined || targetPosition === -1) {
|
1407 |
+
position = -1;
|
1408 |
+
} else {
|
1409 |
+
position = targetPosition;
|
1410 |
+
}
|
1411 |
+
if (position >= base.$userItems.length || position === -1) {
|
1412 |
+
base.$userItems.eq(-1).after(htmlString);
|
1413 |
+
} else {
|
1414 |
+
base.$userItems.eq(position).before(htmlString);
|
1415 |
+
}
|
1416 |
+
|
1417 |
+
base.setVars();
|
1418 |
+
},
|
1419 |
+
|
1420 |
+
removeItem : function (targetPosition) {
|
1421 |
+
var base = this,
|
1422 |
+
position;
|
1423 |
+
|
1424 |
+
if (base.$elem.children().length === 0) {
|
1425 |
+
return false;
|
1426 |
+
}
|
1427 |
+
if (targetPosition === undefined || targetPosition === -1) {
|
1428 |
+
position = -1;
|
1429 |
+
} else {
|
1430 |
+
position = targetPosition;
|
1431 |
+
}
|
1432 |
+
|
1433 |
+
base.unWrap();
|
1434 |
+
base.$userItems.eq(position).remove();
|
1435 |
+
base.setVars();
|
1436 |
+
}
|
1437 |
+
|
1438 |
+
};
|
1439 |
+
|
1440 |
+
$.fn.owlCarousel = function (options) {
|
1441 |
+
return this.each(function () {
|
1442 |
+
if ($(this).data("owl-init") === true) {
|
1443 |
+
return false;
|
1444 |
+
}
|
1445 |
+
$(this).data("owl-init", true);
|
1446 |
+
var carousel = Object.create(Carousel);
|
1447 |
+
carousel.init(options, this);
|
1448 |
+
$.data(this, "owlCarousel", carousel);
|
1449 |
+
});
|
1450 |
+
};
|
1451 |
+
|
1452 |
+
$.fn.owlCarousel.options = {
|
1453 |
+
|
1454 |
+
items : 5,
|
1455 |
+
itemsCustom : false,
|
1456 |
+
itemsDesktop : [1199, 4],
|
1457 |
+
itemsDesktopSmall : [979, 3],
|
1458 |
+
itemsTablet : [768, 2],
|
1459 |
+
itemsTabletSmall : false,
|
1460 |
+
itemsMobile : [479, 1],
|
1461 |
+
singleItem : false,
|
1462 |
+
itemsScaleUp : false,
|
1463 |
+
|
1464 |
+
slideSpeed : 200,
|
1465 |
+
paginationSpeed : 800,
|
1466 |
+
rewindSpeed : 1000,
|
1467 |
+
|
1468 |
+
autoPlay : false,
|
1469 |
+
stopOnHover : false,
|
1470 |
+
|
1471 |
+
navigation : false,
|
1472 |
+
navigationText : ["prev", "next"],
|
1473 |
+
rewindNav : true,
|
1474 |
+
scrollPerPage : false,
|
1475 |
+
|
1476 |
+
pagination : true,
|
1477 |
+
paginationNumbers : false,
|
1478 |
+
|
1479 |
+
responsive : true,
|
1480 |
+
responsiveRefreshRate : 200,
|
1481 |
+
responsiveBaseWidth : window,
|
1482 |
+
|
1483 |
+
baseClass : "owl-carousel",
|
1484 |
+
theme : "owl-theme",
|
1485 |
+
|
1486 |
+
lazyLoad : false,
|
1487 |
+
lazyFollow : true,
|
1488 |
+
lazyEffect : "fade",
|
1489 |
+
|
1490 |
+
autoHeight : false,
|
1491 |
+
|
1492 |
+
jsonPath : false,
|
1493 |
+
jsonSuccess : false,
|
1494 |
+
|
1495 |
+
dragBeforeAnimFinish : true,
|
1496 |
+
mouseDrag : true,
|
1497 |
+
touchDrag : true,
|
1498 |
+
|
1499 |
+
addClassActive : false,
|
1500 |
+
transitionStyle : false,
|
1501 |
+
|
1502 |
+
beforeUpdate : false,
|
1503 |
+
afterUpdate : false,
|
1504 |
+
beforeInit : false,
|
1505 |
+
afterInit : false,
|
1506 |
+
beforeMove : false,
|
1507 |
+
afterMove : false,
|
1508 |
+
afterAction : false,
|
1509 |
+
startDragging : false,
|
1510 |
+
afterLazyLoad: false
|
1511 |
+
};
|
1512 |
+
}(jQuery, window, document));
|
readme.txt
ADDED
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Carousel Slider ===
|
2 |
+
Contributors: sayful
|
3 |
+
Tags: carousel, carousel slider, image carousel, slider, responsive slider,
|
4 |
+
Requires at least: 3.0
|
5 |
+
Tested up to: 3.9.1
|
6 |
+
Stable tag: 1.1
|
7 |
+
License: GPLv2 or later
|
8 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
+
|
10 |
+
Touch enabled wordpress plugin that lets you create beautiful responsive carousel slider.
|
11 |
+
|
12 |
+
== Description ==
|
13 |
+
|
14 |
+
Fully written in jQuery, touch enabled wordpress plugin based on [OWL Carousel](http://www.owlgraphic.com/owlcarousel/) that lets you create beautiful responsive carousel slider.
|
15 |
+
|
16 |
+
Just create your Carousel slider from the Carousels menu & paste the following shortcode where you want to display this carousel slider:
|
17 |
+
|
18 |
+
`[all-carousels]`
|
19 |
+
|
20 |
+
Or you can paste following to add carousel slider to your theme:
|
21 |
+
|
22 |
+
`<?php echo do_shortcode('[all-carousels]'); ?>`
|
23 |
+
|
24 |
+
If you want to use multiple carousel slider at diffrent page or post click on "Add Carousel Slider" button from WordPress visual editor [view screenshot](http://s.w.org/plugins/carousel-slider/screenshot-3.png?r=943201) and inside `img_link=''` put you image link.
|
25 |
+
|
26 |
+
or write the following code:
|
27 |
+
|
28 |
+
`[carousel id="unique-id"][item img_link=""][/carousel]`
|
29 |
+
|
30 |
+
To change default options, you can add the following attributes:
|
31 |
+
|
32 |
+
`[carousel id="" items="" itemsDesktop="" itemsDesktopSmall="" itemsTablet="" itemsMobile="" slideSpeed="" paginationSpeed="" rewindSpeed="" singleItem="false|true" autoPlay="false|true" stopOnHover="false|true" navigation="false|true" scrollPerPage="false|true" pagination="false|true" paginationNumbers="false|true" transitionStyle="fade|backSlide|goDown|scaleUp"][/carousel]`
|
33 |
+
|
34 |
+
Repeat `[item img_link=""]` as many image as you want. Inside `img_link=''` put you image link like
|
35 |
+
|
36 |
+
`img_link='http://lorempixel.com/400/200/sports/1'`
|
37 |
+
|
38 |
+
To get image from your WordPress Media, go to Media >> Library and click on image which one you want to insert and copy URL and paste it into `img_link=''` like this:
|
39 |
+
|
40 |
+
`img_link='http://localhost/wp/plugins/wp-content/uploads/2014/06/vlcsnap-2014-06-08-14h31m10s128.png'`
|
41 |
+
|
42 |
+
Here is a complete example of code of carousel slider with ten image:
|
43 |
+
|
44 |
+
`[carousel id="carousel-1"][item img_link="http://lorempixel.com/400/200/sports/1"][item img_link="http://lorempixel.com/400/200/sports/2"][item img_link="http://lorempixel.com/400/200/sports/3"][item img_link="http://lorempixel.com/400/200/sports/4"][item img_link="http://lorempixel.com/400/200/sports/5"][item img_link="http://lorempixel.com/400/200/sports/6"][item img_link="http://lorempixel.com/400/200/sports/7"][item img_link="http://lorempixel.com/400/200/sports/8"][item img_link="http://lorempixel.com/400/200/sports/9"][item img_link="http://lorempixel.com/400/200/sports/10"][/carousel]`
|
45 |
+
|
46 |
+
<h1>Features</h1>
|
47 |
+
|
48 |
+
1. Fully Responsive
|
49 |
+
2. Unlimited Carousel slider
|
50 |
+
3. Supported in all major browsers
|
51 |
+
4. Touch and Grab enabled
|
52 |
+
5. CSS3 3D Acceleration
|
53 |
+
6. Multiple carousel on single page
|
54 |
+
7. Light as a feather
|
55 |
+
|
56 |
+
== Installation ==
|
57 |
+
|
58 |
+
Installing the plugins is just like installing other WordPress plugins. If you don't know how to install plugins, please review the three options below:
|
59 |
+
|
60 |
+
Install by Search
|
61 |
+
|
62 |
+
* From your WordPress dashboard, choose 'Add New' under the 'Plugins' category.
|
63 |
+
* Search for 'Carousel Slider' a plugin will come called 'Carousel Slider by Sayful Islam' and Click 'Install Now' and confirm your installation by clicking 'ok'
|
64 |
+
* The plugin will download and install. Just click 'Activate Plugin' to activate it.
|
65 |
+
|
66 |
+
Install by ZIP File
|
67 |
+
|
68 |
+
* From your WordPress dashboard, choose 'Add New' under the 'Plugins' category.
|
69 |
+
* Select 'Upload' from the set of links at the top of the page (the second link)
|
70 |
+
* From here, browse for the zip file included in your plugin titled 'carousel-slider.zip' and click the 'Install Now' button
|
71 |
+
* Once installation is complete, activate the plugin to enable its features.
|
72 |
+
|
73 |
+
Install by FTP
|
74 |
+
|
75 |
+
* Find the directory titles 'carousel-slider' and upload it and all files within to the plugins directory of your WordPress install (WORDPRESS-DIRECTORY/wp-content/plugins/) [e.g. www.yourdomain.com/wp-content/plugins/]
|
76 |
+
* From your WordPress dashboard, choose 'Installed Plugins' option under the 'Plugins' category
|
77 |
+
* Locate the newly added plugin and click on the \'Activate\' link to enable its features.
|
78 |
+
|
79 |
+
|
80 |
+
== Frequently Asked Questions ==
|
81 |
+
Do you have questions or issues with Carousel Slider? [Ask for support here](http://wordpress.org/support/plugin/carousel-slider)
|
82 |
+
|
83 |
+
== Screenshots ==
|
84 |
+
|
85 |
+
1. Screenshot of Carousels custom post.
|
86 |
+
2. Screenshot of Options page.
|
87 |
+
3. Screenshot of Carousel shortcode button.
|
88 |
+
4. Screenshot of Carousel Front-end Example.
|
89 |
+
|
90 |
+
== Changelog ==
|
91 |
+
|
92 |
+
= version 1.0 =
|
93 |
+
Implementation of basic functionality.
|
94 |
+
|
95 |
+
== Upgrade Notice ==
|
96 |
+
Upgrade the plugin to get more features and better performance.
|
97 |
+
|
98 |
+
== CREDIT ==
|
99 |
+
|
100 |
+
1.This plugin was developed by [Sayful Islam](http://sayful.net)
|
101 |
+
1.Some open source framework have been used. For detail [click here](http://owlgraphic.com/owlcarousel/)
|
102 |
+
|
103 |
+
== CONTACT ==
|
104 |
+
|
105 |
+
[Sayful Islam](http://sayful1.wordpress.com/100-2/)
|
screenshot-1.png
ADDED
Binary file
|
screenshot-2.png
ADDED
Binary file
|
screenshot-3.png
ADDED
Binary file
|
screenshot-4.png
ADDED
Binary file
|
uninstall.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// If uninstall not called from WordPress, then exit
|
4 |
+
if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ){
|
5 |
+
exit;
|
6 |
+
}
|
7 |
+
// If uninstall called from WordPress, then delete option
|
8 |
+
if ( get_option( 'sis_carousel_settings' ) != false ){
|
9 |
+
delete_option( 'sis_carousel_settings' );
|
10 |
+
}
|
11 |
+
|
12 |
+
?>
|