Advertisement
Guest User

custom slider

a guest
Aug 30th, 2013
230
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var $j = jQuery.noConflict();
  2.  
  3. $j(function(){
  4.  
  5.     //** MAIN LAYOUT **//
  6.     var main_page_width = $j('input[name="theme_options[main_page_width]"]').val();
  7.  
  8.     // wait till iframe has been loaded
  9.     setTimeout(function() {
  10.                  
  11.         // Main Page Width
  12.         $j('input[name="theme_options[main_page_width]"]').next('div.slider').slider({
  13.             value: main_page_width,
  14.             min: 800,
  15.             max: 1200,
  16.             slide: function( event, ui ) {
  17.                        
  18.                 // Change input value and slider position
  19.                 $j('input[name="theme_options[main_page_width]"]').val( ui.value ).change();
  20.                        
  21.                 // Change CSS in LivePreview           
  22.                 $j("iframe").contents().find('div.container').css('width', ui.value+'px');
  23.                    
  24.             }
  25.         });
  26.  
  27.     });
  28.  
  29. });
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement