Question : Floating window in Ruby on Rails

Hi,

I need to be able to display some information in a floating window using ruby on rails code.
can somebody help me with that?
thanks.

Answer : Floating window in Ruby on Rails

@d2Marcelo...

I'm guessing that you want some kind of floating / pop-up window that you can display on command -- as when a user mouses over a field... if that is correct, then I have a great solution: one that I am using on my rails website (4mypasswords.com) for displaying the terms of service. This acts like the floating windows that netflix uses to display the descriptions of their dvds.  To use this:

1. Get the "DOM Popup Kit" by Stuart Rackham at www.methods.co.nz/popup/popup.html -- they have great instructions in the download (it can be used with or without Rails).
2. Here's the code that I use on my site. I just use the default css formatting, but it could be greatly enhanced with a little CSS work.

As you can see, I use the same partial in two different places thru the shared/ directory.

HTH...jon
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
[1] in application.rhtml to include the popup code:
	<%= javascript_include_tag 'popup.js' %>
	<%= stylesheet_link_tag 'popup.css' %>
 
[2] in signup.rhtml to define the link/render it

...
<%= render :partial => 'shared/tos_popup' %>
 
[3] in _sidebar.rhtml to define the link/render it
Terms of Service	
...
<%= render :partial => 'shared/tos_popup' %>
 
[4] The Partial: shared/_tos_popup.rhtml

<%= javascript_tag "new Popup('tos_popup','tos_link', {position:'center'})" %>
Open in New Window Select All
Random Solutions  
 
programming4us programming4us