tags:

views:

27

answers:

1

I'm creating a jquery lightbox for a website i'm developing, no thank you i don't want any pre-built lightboxes. curious if anyone knows what would be a smoother fade in for the half transparent black overlay(that fades out the website so you can see the white div popup), would animating the opacity be smoother, or would simply using

$('.overlay')fadeIn('normal') 

be a smoother fade in for the black div overlay background. i'm so tired right now and for some reason i can't get anything to work... not even a simple demo... and i'm just irritated so i figured i'd just ask... :/

+3  A: 

$.fadeIn() uses $.animate() under the hood, I believe. So picking between either of these options isn't going to give you a "smoother" transition.

fadeTo: function(speed,to,callback) {
  return this.filter(":hidden").css('opacity', 0).show().end()
         .animate({opacity: to}, speed, callback);
}

Source: http://dev.jquery.com/browser/trunk/jquery/src/fx.js line 97

Jonathan Sampson