mercredi 5 août 2015

How to animate input box and btn search


I have the following code and animation is not working as expected. On focusout inputbox animates nice but btn_search returns to its place without animation.

 <div class="form-group">
     {!!Form::text('pretraga',null,['id'=>'pretraga','class'=>'form-control','placeholder'=>'pretraga...'])!!}
 </div>
 <div class="form-group">
     {!!Form::button('<span class="glyphicon glyphicon-search"></span>', ['id'=>'btn_search', 'class'=>'btn btn-default'])!!}
 </div>

             $("#pretraga").click(function (e) {
                    e.preventDefault();
                    $(this).animate({width: '250px'}, "slow");
                });
             $("#pretraga").focusout(function(e){
                e.preventDefault();
                $(this).animate({width: '100%'}, "slow");
             });



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire