Advertisement
Guest User

Untitled

a guest
Dec 1st, 2013
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. jQuery(function($){
  2.  
  3.     /*======================================================================*\
  4.         Columns
  5.     \*======================================================================*/
  6.  
  7.     // cache ColumnLength
  8.     var columnLength = $('input[name="ColumnLength"]');
  9.  
  10.     // Onload check the value of ColumnLength
  11.     showHideColumns(columnLength.val());
  12.  
  13.     // When ColumnLength is changed run showHideColumns
  14.     columnLength.change(function(){
  15.         var $val = $(this).val();
  16.         showHideColumns($val);
  17.     });
  18.  
  19.     // Show/Hide columns based on ColumnLength
  20.     function showHideColumns(e){
  21.         switch(e){
  22.             case '2':
  23.                 $('#ColumnThree, #ColumnFour').hide();
  24.                 break;
  25.             case '3':
  26.                 $('#ColumnThree').show();
  27.                 $('#ColumnFour').hide();
  28.                 break;
  29.             case '4':
  30.                 $('#ColumnThree, #ColumnFour').show();
  31.                 break;
  32.         }
  33.     }
  34.  
  35. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement