views:

58

answers:

3

When the user clicks on a link, I want to open a modal window (like the ones used in stack overflow, but centered).

If the browser doesn't allow to open floating div, then go to another page.

Is there an easy way to do this in Rails? (otherwise I can code it from scratch)

+2  A: 

None of this would be handled in Rails, I would think. I would think that you would handle this in Javascript.

That being said, almost all browsers support javascript. Browsing the web without it (mobile devices being the exception) is almost never done. DIVs that float over other elements have been supported in browsers for many, many years. Even IE6 supports it (as long as you aren't overlapping a SELECT element). I would just assume that the browser can do it, unless you're coding for a mobile site.

Dave Markle
A: 

If you mean a modal window, then you could use this jQuery plugin.

ryanulit
or JQueryUI (http://jqueryui.com) as a Dialog widget.
cjstehno
yes, i meant a modal window. I edited the description.
Victor P
+1  A: 

If you are using Prototype and Scriptaculous you can use ModalBox.

MattMcKnight