Well in slow browsers, the show / hide method MAY cause a window to flicker (although the computer should be very slow). Therefore, if you want to avoid this, give the div opacity: 0 - and possibly even a position: absolute, so it does not push the content. Therefore, to extend the code to:
var $myEl = $('#myElement').css({"opacity": "0", "position": "absolute"}).show(); var height = $myEl.height(); $myEl.hide().css({"opacity": "", "position": ""});
But again. This may be redundant.
source share