jquery - How do you close the Iris colour picker when you click away from color picker? -


how close iris colour picker when click away color picker? used below code

jquery(document).ready(function($) {     $('.my-color-picker').iris({         palettes: true,         target: false     }); }); 

try this:-

jquery(document).ready(function ($) {     $('.my-color-picker').iris();     $(document).click(function (e) {     if (!$(e.target).is(".my-color-picker, .iris-picker, .iris-picker-inner")) {         $('.my-color-picker').iris('hide');         return false;     } }); $('.my-color-picker').click(function (event) {     $('.my-color-picker').iris('hide');     $(this).iris('show');     return false; }); 

});

demo


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -