jquery accordion flashes a couple of times in firefox (like the page is loading... kinda)
Hi best seen then said :)
http://www.tsa开发者_开发百科kalos-advertising.gr/portfolio.html
when i click on video (the last one) it flickers/flashes call it what you will. I only seem to get this in firefox. Any ideas how to fix this?
thanks :)
This is happening because the height of the window is shrinking as the animation is occurring, the multiple repaints and reflows causing the flicker effect. Notice that it doesn't occur when an accordion is selected that doesn't shrink the height of the window. You can fix this by setting the height of the #main_portfolio
div to equal the height of the contents instead of just height:auto
. You'll want to have this set on a delay also so that it changes after the animation of the accordion is complete, like so:
var forceAccHeight = function () {
$('#main_portfolio').css('height':$(this).height());
};
$('.acc_trigger').click(function(e){
setTimeout(forceAccHeight, 600);
});
forceAccHeight();
精彩评论