Created
August 30, 2011 16:11
-
-
Save seedprod/1181262 to your computer and use it in GitHub Desktop.
WordPress Color Picker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="text" name="my-theme-options[color]" id="color" /> | |
<input type='button' class='pickcolor button-secondary' value='Select Color'> | |
<div id='colorpicker' style='z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;'></div> | |
// Color Picker for js file | |
$('.pickcolor').click( function(e) { | |
colorPicker = jQuery(this).next('div'); | |
input = jQuery(this).prev('input'); | |
$(colorPicker).farbtastic(input); | |
colorPicker.show(); | |
e.preventDefault(); | |
$(document).mousedown( function() { | |
$(colorPicker).hide(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment