javascript - Temporarily animate input type text when hovering -
i want show contents of input type text if text wider current input width.
when hover field, want text scroll left or similar, in order view hidden text.
thank you.
note: tell me if have add/change question's tags, please.
i thought how , came with.
on input hover i'm going take input value , put in div (or other element). width of div , compare width of input. if div wider input i'm going animate inputs text-indent difference of widths.
$('input').hover(function(){ var temp = $('div').html($(this).val()).width(); if($(this).width() < temp){ $(this).animate({ textindent: $(this).width()-temp }, 100); } });
you can see full solution here: http://jsfiddle.net/taneleero/tb5c5/2/
should enough going.
Comments
Post a Comment