I have a container that works like notifications in mac os - items are added to the queue and deleted after a certain timeout. This works great, but has one sharp visual side effect.
When they are removed from the DOM, an uneven update appears in the user interface, since the next item in the stack fills the void created by the previous item. I would like the elements below on the stack to move smoothly into this space, ideally with css3, but adding the transition: all 0.5s ease-in-out class to the .notice class .notice not affect the object when its brother was deleted .
Minimum JS Interference:
$('#add').click(function(e) { e.preventDefault(); $('#container').append('<p class="notice">Notice #</p>'); }); $('body').on('click','p.notice', function(e) { $(this).fadeOut(); });
Better still a fiddle here:
http://jsfiddle.net/kMxqj/
I use the MVC environment to bind data to these objects, so some native css / jQuery is preferable over the Jq plugin.
source share