0

I'm using colorpicker Spectrum and what I'm trying to do is to open the colorpicker window when the input is focused. But the problem is that the colorpicker only shows for a split second and then closes. JSfiddle

HTML:

<input type="text">

Javascript:

$('input').spectrum().show();
$('input').focus(function() {
  $(this).spectrum('show');
});
Chanckjh
  • 2,587
  • 2
  • 22
  • 28

1 Answers1

0

Use this code:

  $('input').spectrum().show();
  $("input").bind('focus click', function() { 
      $(this).spectrum("show");
      return false;
   });

jsfiddle

SEAN
  • 51
  • 5