Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  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. });​
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement