简体   繁体   中英

Transition position change when element removed from DOM

I have a vertical list of images that the user can delete by clicking on them. Once the element is removed from DOM, the next element in line snaps upward to its position. How can I do a smooth CSS transition for this position change?

http://jsbin.com/dewiqilope/edit?html,js,output

You can use jQuery animations.

$('#element-selector').on('click', function () {
    $(this).slideUp(); // also you can use .fadeOut()
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM