Slide Anything – Responsive Content / HTML Slider and Carousel - Version 2.1.9

Version Description

  • Added a new 'Use window.onload event' checkbox setting. By default, Slide Anything loads it JavaSctipt/jQuery code during the 'document.ready' event. If this new option is checked, then the JavaSctipt/jQuery code is loaded during the 'window.onload' event, and this event is only executed after all the assets for the page have been loaded - all images, CSS etc. Using this option solves an issue that sometimes occurs when inserting a Slide Anything slider into a Visual Composer full-width section, and these full-width containers are created/calculated dynamically by adding negative left/right margins to the container after the SA JavaScript/jQuery code is executed.

=

Download this release

Release Info

Developer simonpedge
Plugin Icon 128x128 Slide Anything – Responsive Content / HTML Slider and Carousel
Version 2.1.9
Comparing to
See all releases

Code changes from version 2.1.8 to 2.1.9

css/slide-anything-admin.css CHANGED
@@ -901,6 +901,22 @@ input.sa_slide_popup_imagetitle:-ms-input-placeholder { color:#c0c0c0 !important
901
  height:20px !important;
902
  cursor:help;
903
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
904
 
905
  /* ### METABOX 'Information' - 'SLIDE ADDED', 'SLIDE DELETED', 'SLIDE DUPLICATED' & 'SLIDE MOVED' INFO MESSAGES ### */
906
  #sa_slide_added_mess,
901
  height:20px !important;
902
  cursor:help;
903
  }
904
+ /* other settings */
905
+ #slider_style_metabox #sa_window_onload_line {
906
+ padding:5px 0px 10px 0px !important;
907
+ font-size:13px !important;
908
+ line-height:18px !important;
909
+ cursor:help !important;
910
+ }
911
+ #slider_style_metabox #sa_window_onload_line span {
912
+ margin-right:5px;
913
+ float:left !important;
914
+ display:block !important;
915
+ }
916
+ #slider_style_metabox #sa_window_onload_line input[type=checkbox] {
917
+ margin-left:10px !important;
918
+ margin-right:0px !important;
919
+ }
920
 
921
  /* ### METABOX 'Information' - 'SLIDE ADDED', 'SLIDE DELETED', 'SLIDE DUPLICATED' & 'SLIDE MOVED' INFO MESSAGES ### */
922
  #sa_slide_added_mess,
php/slide-anything-admin.php CHANGED
@@ -1659,6 +1659,24 @@ function cpt_slider_style_content($post) {
1659
  }
1660
  echo "</select></div>\n";
1661
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1662
  echo "</div>\n";
1663
  }
1664
 
@@ -2033,6 +2051,13 @@ function cpt_slider_save_postdata() {
2033
  } else {
2034
  update_post_meta($post->ID, 'sa_slide_icons_visible', '0');
2035
  }
 
 
 
 
 
 
 
2036
  }
2037
  }
2038
 
1659
  }
1660
  echo "</select></div>\n";
1661
 
1662
+ echo "<h4 style='margin-top:10px !important;'>Other Settings:</h4>";
1663
+
1664
+ // USE 'window.onload' EVENT (checkbox)
1665
+ $window_onload = get_post_meta($post->ID, 'sa_window_onload', true);
1666
+ if ($window_onload == '') {
1667
+ $window_onload = '0';
1668
+ }
1669
+ $tooltip = 'Use this option if your slider is not being sized correctly within your page container ';
1670
+ $tooltip .= '(sometimes occurs with Visual Composer full-width sections)';
1671
+ echo "<div id='sa_window_onload_line'>";
1672
+ echo "<span class='sa_tooltip' title='".$tooltip."'></span>Use 'window.onload' event:";
1673
+ if ($window_onload == '1') {
1674
+ echo "<input type='checkbox' id='sa_window_onload' name='sa_window_onload' value='1' checked/>";
1675
+ } else {
1676
+ echo "<input type='checkbox' id='sa_window_onload' name='sa_window_onload' value='1'/>";
1677
+ }
1678
+ echo "</div>\n";
1679
+
1680
  echo "</div>\n";
1681
  }
1682
 
2051
  } else {
2052
  update_post_meta($post->ID, 'sa_slide_icons_visible', '0');
2053
  }
2054
+
2055
+ // OTHER SETTINGS
2056
+ if (isset($_POST['sa_window_onload']) && ($_POST['sa_window_onload'] == '1')) {
2057
+ update_post_meta($post->ID, 'sa_window_onload', '1');
2058
+ } else {
2059
+ update_post_meta($post->ID, 'sa_window_onload', '0');
2060
+ }
2061
  }
2062
  }
2063
 
php/slide-anything-frontend.php CHANGED
@@ -218,6 +218,10 @@ function slide_anything_shortcode($atts) {
218
  if ($slide_data['slide_icons_color'] != 'black') {
219
  $slide_data['slide_icons_color'] = 'white';
220
  }
 
 
 
 
221
 
222
  // REVERSE THE ORDER OF THE SLIDES IF 'Random Order' CHECKBOX IS CHECKED OR
223
  // RE-ORDER SLIDES IN A RANDOM ORDER IF 'Random Order' CHECKBOX IS CHECKED
@@ -456,7 +460,11 @@ function slide_anything_shortcode($atts) {
456
  $single_item = 0;
457
  }
458
  $output .= "<script type='text/javascript'>\n";
459
- $output .= " jQuery(document).ready(function() {\n";
 
 
 
 
460
 
461
  // JQUERY CODE FOR OWN CAROUSEL
462
  $output .= " jQuery('#".esc_attr($slide_data['css_id'])."').owlCarousel({\n";
218
  if ($slide_data['slide_icons_color'] != 'black') {
219
  $slide_data['slide_icons_color'] = 'white';
220
  }
221
+ $slide_data['sa_window_onload'] = $metadata['sa_window_onload'][0];
222
+ if ($slide_data['sa_window_onload'] != '1') {
223
+ $slide_data['sa_window_onload'] = '0';
224
+ }
225
 
226
  // REVERSE THE ORDER OF THE SLIDES IF 'Random Order' CHECKBOX IS CHECKED OR
227
  // RE-ORDER SLIDES IN A RANDOM ORDER IF 'Random Order' CHECKBOX IS CHECKED
460
  $single_item = 0;
461
  }
462
  $output .= "<script type='text/javascript'>\n";
463
+ if ($slide_data['sa_window_onload'] == '1') {
464
+ $output .= " jQuery(window).load(function() {\n";
465
+ } else {
466
+ $output .= " jQuery(document).ready(function() {\n";
467
+ }
468
 
469
  // JQUERY CODE FOR OWN CAROUSEL
470
  $output .= " jQuery('#".esc_attr($slide_data['css_id'])."').owlCarousel({\n";
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: simonpedge
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RP7JLGK6VT252
4
  Tags: slider, carousel, content slider, responsive slider, html slider, owl carousel
5
  Requires at least: 4.0
6
- Tested up to: 4.9.6
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -211,6 +211,9 @@ The `SLIDE STYLE` settings are the style settings for each individual slide with
211
  * Added the Slide By 'page' option, which is set by setting the 'Slide By' slider input to 0.
212
  * For Slide Anything PRO YouTube video popups, added the 'rel=0' paramerter so that related videos are not displayed at the end of a video playback. This has been requested quite a bit, and I have modified the 'Magnific Popup' code so that this parameter is added to the iframe code generated.
213
 
 
 
 
214
  == Upgrade Notice ==
215
 
216
  = 1.0 =
@@ -336,4 +339,7 @@ The `SLIDE STYLE` settings are the style settings for each individual slide with
336
 
337
  = 2.1.8 =
338
  * Added the Slide By 'page' option, which is set by setting the 'Slide By' slider input to 0.
339
- * For Slide Anything PRO YouTube video popups, added the 'rel=0' paramerter so that related videos are not displayed at the end of a video playback. This has been requested quite a bit, and I have modified the 'Magnific Popup' code so that this parameter is added to the iframe code generated.
 
 
 
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RP7JLGK6VT252
4
  Tags: slider, carousel, content slider, responsive slider, html slider, owl carousel
5
  Requires at least: 4.0
6
+ Tested up to: 4.9.7
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
211
  * Added the Slide By 'page' option, which is set by setting the 'Slide By' slider input to 0.
212
  * For Slide Anything PRO YouTube video popups, added the 'rel=0' paramerter so that related videos are not displayed at the end of a video playback. This has been requested quite a bit, and I have modified the 'Magnific Popup' code so that this parameter is added to the iframe code generated.
213
 
214
+ = 2.1.9 =
215
+ * Added a new 'Use window.onload event' checkbox setting. By default, Slide Anything loads it JavaSctipt/jQuery code during the 'document.ready' event. If this new option is checked, then the JavaSctipt/jQuery code is loaded during the 'window.onload' event, and this event is only executed after all the assets for the page have been loaded - all images, CSS etc. Using this option solves an issue that sometimes occurs when inserting a Slide Anything slider into a Visual Composer full-width section, and these full-width containers are created/calculated dynamically by adding negative left/right margins to the container after the SA JavaScript/jQuery code is executed.
216
+
217
  == Upgrade Notice ==
218
 
219
  = 1.0 =
339
 
340
  = 2.1.8 =
341
  * Added the Slide By 'page' option, which is set by setting the 'Slide By' slider input to 0.
342
+ * For Slide Anything PRO YouTube video popups, added the 'rel=0' paramerter so that related videos are not displayed at the end of a video playback. This has been requested quite a bit, and I have modified the 'Magnific Popup' code so that this parameter is added to the iframe code generated.
343
+
344
+ = 2.1.9 =
345
+ * Added a new 'Use window.onload event' checkbox setting. By default, Slide Anything loads it JavaSctipt/jQuery code during the 'document.ready' event. If this new option is checked, then the JavaSctipt/jQuery code is loaded during the 'window.onload' event, and this event is only executed after all the assets for the page have been loaded - all images, CSS etc. Using this option solves an issue that sometimes occurs when inserting a Slide Anything slider into a Visual Composer full-width section, and these full-width containers are created/calculated dynamically by adding negative left/right margins to the container after the SA JavaScript/jQuery code is executed.
slide-anything.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: https://wordpress.org/plugins/slide-anything/
5
  * Description: Slide Anything allows you to create a carousel/slider where the content for each slide can be anything you want - images, text, HTML, and even shortcodes. This plugin uses the Owl Carousel jQuery plugin, and lets you create beautiful, touch enabled, responsive carousels and sliders.
6
  * Author: Simon Edge
7
- * Version: 2.1.8
8
  * License: GPLv2 or later
9
  */
10
 
4
  * Plugin URI: https://wordpress.org/plugins/slide-anything/
5
  * Description: Slide Anything allows you to create a carousel/slider where the content for each slide can be anything you want - images, text, HTML, and even shortcodes. This plugin uses the Owl Carousel jQuery plugin, and lets you create beautiful, touch enabled, responsive carousels and sliders.
6
  * Author: Simon Edge
7
+ * Version: 2.1.9
8
  * License: GPLv2 or later
9
  */
10