If you go to digg.com and click the login button, there’s a nice little in screen popup that comes up to put in user data, etc.
I’m wondering what is the best way of doing that? My site is written in RoR and I have some javascript elements in there. When I try to search for javascript Popup, I only get window.open(…) but nothing about how to setup this “soft popup”
Any idea on how this is coded up? Thanks!
Like I said, while this might sound like a silly question, I have no idea what to search for (every search for javascript popup yields an ACTUAL window popup, not this smooth fading popup of sorts)
There are a number of names for this. A pop up window is a plain javascript window that “pops” open and usually has smaller dimensions. You’ll notice sometimes when you click through sites one of these may open behind your current page and be displaying and ad.
What you’re looking for is usually referred to as a modal or dialog. If you are using jQuery then there are a number of plugins for this. I believe colorbox is the latest and best supported. http://colorpowered.com/colorbox/
If you are not using jQuery it isn’t that much more difficult. The idea behind this practice is to position an html element on top of your current ui. As you see on digg.com they put what is called an overlay on top of their ui. You position your box using
This gives it the effect of hovering above the ui. then all you need to do is style your overlay in the way you want. you will have to calculate page dimensions to get your overlay positioned properly but that isn’t too hard.