Lightbox effect with Jquery

Posted by Sarfraz on Stack Overflow See other posts from Stack Overflow or by Sarfraz
Published on 2010-03-08T06:39:38Z Indexed on 2010/03/08 6:51 UTC
Read the original article Hit count: 145

Filed under:
|
|
|
|

Hello,

I just wanted to know how to create lightbox effect with JQuery, I mean let's suppose I have div, and when i click some button it shows that div at the center of the browser window across all browsers with a transparent background behind. In this div i could show just about anything including a form, image, or some text so it becomes sort of stylish alert box.

So how to:

Center a div across all browsers and behind this div put a transparent background covering entire screen of browser.

Note: I know there are a host such effects out there, i just want to know how do i create a simple centered div with transparent background behind. So please don't suggest any pre-made solution, would be great if you could write sample code for that.

Thanks

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript