Run two jQuery functions at the same time

后端 未结 4 1902
难免孤独
难免孤独 2021-01-19 12:14

I am using jQuery to slide something down and fade something else out, but in testing it, I\'ve noticed that the fading appears too long after the sliding happens. In other

4条回答
  •  没有蜡笔的小新
    2021-01-19 12:52

    They should run together if you do it like:

    $('#element1').animate({
        opacity: 0.25,
        }, 1000, function() {
            // complete
    });
    
    $('#element2').animate({
        opacity: 0,
        }, 1000, function() {
            // complete
    });
    

提交回复
热议问题