swte

Sample Server Side Script (Revslider Full Height Slider)

May 10th, 2021
549
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if (document.querySelector('.rev_slider_wrapper') !== null){
  2.     // Get the first slide element
  3.     var slide = document.querySelector('rs-slide img:first-child');
  4.  
  5.     // Clone first slide
  6.     var clone = slide.cloneNode(true);
  7.  
  8.     // Create a wrapper
  9.     var cloneWrapper = document.createElement('div');
  10.  
  11.     // Add class name to the wrapper
  12.     cloneWrapper.classList.add('pseudo-slide-wrapper');
  13.  
  14.     // Add class name to the cloned slide
  15.     clone.classList.add('pseudo-slide');
  16.  
  17.     // Add the wrapper to DOM
  18.     cloneWrapper.append(clone);
  19.  
  20.     // Add the slide to the wrapper
  21.     document.querySelector('.rev_slider_wrapper').prepend(cloneWrapper);
  22. }
RAW Paste Data