Created
August 29, 2011 15:59
-
-
Save rnmp/1178710 to your computer and use it in GitHub Desktop.
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
$(document).bind('keydown', 'h', function() { | |
$hex.toggle(function() { | |
$(this).hide(); | |
}, function() { | |
$(this).show(); | |
}); | |
}); |
Aunque depende de qué sea $hex, no lo he revisado :D
$(function(){
var $body = $('body'),
$color = $('.color'),
$hex = $('.hex'),
$prefix = $('.prefix'),
$input_id = 'clipboard_handler';
$body.prepend('<input id="'+$input_id+'" disabled type="text" />');
$color.hover(function() {
var $hex_code = $('.hex', this).text();
$('#'+$input_id).val($hex_code).select();
});
$hex.each(function(){
// This clears the HEX value provided
$(this).text($(this).text().replace('#',''));
$(this).prepend('<span class="prefix" />');
$('.prefix', this).text('#');
});
$(document).bind('keydown', 'h', function(){
$(this).toggle(function(){
$hex.hide();
}, function(){
$hex.show();
})
});
});
Así es el código completo, implementando tu solución. Que no funciona. D:
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yo aplicaría el toggle al this del document: