Form doesn't move up on submit

后端 未结 3 884
粉色の甜心
粉色の甜心 2021-01-24 05:59

I\'m trying to move the form up a few pixels and this doesn\'t work. I don\'t know why.

The function is being called when I submit (I have tested it with an alert()), bu

3条回答
  •  太阳男子
    2021-01-24 06:29

    If you want it to work with .animate() try this:

    $(document).ready(function () {
        $("#formulario").submit(function (event) {
            event.preventDefault();
            $(this).css('position', 'relative')
                .animate({top: '-50px'}, 5000, function () {
                    // Animation complete.
                })
        });
    });
    

提交回复
热议问题