views:

22

answers:

2

I want to create an in-window pop up that darkens the entire window with a semi-transparent black overlay and there is a popup in the middle that warns the user about something. I have seen something like this on att web site

http://www.att.com/wireless/iphone/?wtSlotClick=1-003G93!CIWM01-3-1&rel=nofollow

and if you click on the order now button it will give a pop up and darkens the entire window. I know very little of javascript (close to 0) and I am currently using Rails to find the answer. Does anyone know a quick way for me to achieving this effect?

A: 

http://www.emanueleferonato.com/2007/08/22/create-a-lightbox-effect-only-with-css-no-javascript-needed/

That are called lightboxes, and can be done using only CSS (but if you want it activated onclick then javascript is required).

Tom
There are also solutions that are rails-specific, ie. http://code.google.com/p/rb-lightbox-plugin/.
Tom
but this is supposed to be for a dialog box. when i was looking at lightbox i think this implementation is best used for images only? let me know if im wrong.
denniss
We you can certainly style the lightbox differently, thats up to you. Just place your form in it, they are functionally equivalent.
Tom
+1  A: 

If you are using prototype and don't want to roll your own, check out the excellent http://www.nickstakenburg.com/projects/lightview/. note that it will cost you 50 bucks, but its probably the nicest implementation I have seen

If you don't mind including jquery, I usually use http://defunkt.github.com/facebox/ when I need similar functionality.

Matt Briggs
this works flawlessly.
denniss