cmoreira

reload slider after screen resize

Mar 24th, 2016
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. jQuery(document).ready(function($){
  2.  
  3.  
  4.         jQuery(window).on('resize orientationchange', function($) {
  5.  
  6.  
  7.             clearTimeout(jQuery.data(this, 'resizeTimer'));
  8.             jQuery.data(this, 'resizeTimer', setTimeout(function() {
  9.                
  10.                 for (var i = 0; i < ls_curr_slider.length; i++) {
  11.  
  12.  
  13.                     if (typeof ls_curr_slider[i] != 'undefined') {
  14.                       ls_curr_slider[i].destroySlider();
  15.                       ls_curr_slider[i] = undefined;
  16.                      
  17.                     }
  18.  
  19.                 }
  20.  
  21.                 for (var key in lssliderparam) {   
  22.                     console.log(lssliderparam[key]['divid']);
  23.                     jQuery(lssliderparam[key]['divid']).css("opacity", 1).parent().prop( "style", null );
  24.  
  25.                 }
  26.  
  27.                 ls_trigger_sliders();
  28.  
  29.             }, 500));
  30.  
  31.         });
  32.  
  33.  
  34.     });
Advertisement
Add Comment
Please, Sign In to add comment