I have a function that works perfectly if you want to expand an input type=text
with more than 20 characters. My problem is, how to apply this function for disabled inputs? To better understand the behavior of my function check my example on fiddle:
http://jsfiddle.net/DCjYA/168/
$('input[type!="submit"]').focus(function(){
if ($(this).val().length > 20) {
$(this).attr('data-default', $(this).width());
$(this).animate({width: 300}, 'slow');
$(this).parent().addClass('cooling');
}
}).blur(function(){
var w = $(this).attr('data-default');
$(this).animate({
width: w
}, 'slow');
$(this).parent().removeClass('cooling');
});
Thank you.