Universal fix for Safari jQuery bugs?
Details: Safari 2.0.4 on Mac, JQuery 1.2.1
I had a good time breaking my head over jQuery rendering bugs in Safari. Somehow I managed to find the fixes for the bugs I encountered. I hope this post will come handy to those who WILL come across the bugs. The fault is Safari’s.
Bug 1: Objects blink out when doing a fadeIn (basically a call to the animate function with opacity property) animation.
Bug 2: Objects dislocate when doing a fadeIn animation.
For bug no.1, when you select the empty space left by the object that disappeared, the object reappears most of them time. That hints, some axial action needs to be done on the object to make it reappear or prevent it from disappearing.
This is how we do it:
$(’#foo’).fadeIn(‘slow’, function() {
$(’#foo’).css(‘position’, ‘relative’).css(‘left’, 0).css(‘top’, 0);
});
We force a position property on it for an axial action with no real effect (left:0, top:0).
Bug no.2 gave me no hints as how I might fix it. But applying the same fix solved it.
I remember telling someone to try that fix for an unrelated bug resulting at the end of a jQuery animation. Don’t remember the details but looks like it fixed that too.
Universal fix for Safari jQuery bugs?
































































