SHARE
TWEET

Untitled

a guest Feb 21st, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $('.box').ColorPicker();
  2.    
  3. $(document).on('click', '.box', function(){
  4.       $(this).ColorPicker();
  5. });
  6.    
  7. <div class="colorpicker">
  8.     <div class='box'>Color</div>
  9. </div>
  10.  
  11. <input type="button" id="btn1" value="Add New Color Picker" />    
  12.  
  13. $(function() {
  14.     // Adding the Default colorPicker here
  15.     $('.box').ColorPicker();
  16.  
  17.     $('#btn1').on('click' , function(){
  18.         // Add the ColorPicker to the new Element added Here
  19.  
  20.         $('.colorpicker').append('<div class="box1">New Color</div>');
  21.         $('div div').last().ColorPicker();
  22.  
  23.     });        
  24. });​
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