Mateusz Wijas | Journal Coding, hacking, building

Archive for July 2011

Smooth animations with callbacks

This is something I’ve learned recently. Code like the following can be troublesome. Elements may be jumping around a bit depending on your HTML/CSS. $(document).ready(function() { $(“#some_element”).fadeOut(‘slow’); $(“another_element”).fadeIn(‘slow’); });   Instead try using callbacks. A callback is a function that is called after the current function has finished. In the previous example an empty callback [...]