SHARE
TWEET

main-front.js

a guest Nov 14th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. jQuery(document).ready(function(){
  2.    
  3.     var wp_automatic_main_scr = jQuery('.wp_automatic_gallery:first-child').attr('src');
  4.      
  5.     jQuery('.wp_automatic_gallery:first-child').before('<div class="wp_automatic_gallery_wrap"><div style="background-image:url(\'' + wp_automatic_main_scr +'\')" class="wp_automatic_gallery_main" ></div><div class="clear"></div></div>');
  6.    
  7.    
  8.     jQuery('.wp_automatic_gallery').each(function(){
  9.        
  10.         jQuery('.wp_automatic_gallery_wrap').append('<div class="wp_automatic_gallery_btn" style="background-image:url(\''+ jQuery(this).attr('src') + '\')" ></div>');
  11.         jQuery(this).remove();
  12.     });
  13.    
  14.    
  15.     jQuery('.wp_automatic_gallery_btn:last').after('<div style="clear:both"></div><br>');
  16.    
  17.    
  18.    
  19.     jQuery('.wp_automatic_gallery_btn').click(function(){
  20.      
  21.       jQuery('.wp_automatic_gallery_main').css('background-image', jQuery(this).css('background-image')  );
  22.      
  23.     });
  24.  
  25.    
  26. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top