# Help with Redbox Styling and auto-resizing like Lightbox?

**URL:** <https://www.ruby-forum.com/t/help-with-redbox-styling-and-auto-resizing-like-lightbox/165030>\
**Category:** Rails\
**Created:** [April 8, 2009, 12:45pm UTC](https://www.ruby-forum.com/t/help-with-redbox-styling-and-auto-resizing-like-lightbox/165030 "2009-04-08T12:45:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b9bd4f/32.png) [@ram](https://www.ruby-forum.com/u/ram)\
**Post date:** [April 8, 2009, 12:45pm UTC](https://www.ruby-forum.com/t/help-with-redbox-styling-and-auto-resizing-like-lightbox/165030/1 "2009-04-08T12:45:37Z")

</div>

Hi all,

Redbox I think is by far the easiest to implement in Rails as a light-  
box/modal pop-up solution. Even more so if you want to avoid using  
JQuery.

It would however be sweeter if it has better styling and that cool  
auto-resizing thing that lightbox does.  
I couldnt find anything online that addressed this problem (although I  
HAVE seen the feature in many sites). So I thought ill start a  
discussion here…  
Some notes…

-Lightbox accomplishes auto-resizing by using the image’s size  
attributes. This however, is not available in the case of forms (which  
is probably the biggest use-case for something like Redbox in Rails  
apps).

-How can the resizing visual effect be accomplished using Prototype  
+Scriptaculous?

-RB\_window is the css id in redbox.css which ive been playing with for  
repositioning. Thats probably where most of the styling for this  
should go (?)

-Using the original code, the redbox always appears at the top of the  
viewport/window and widthwise center of it regardless of the scroll  
position (dont know about others). How does one make it appear at the  
center of the viewport (heightwise as well as widthwise) no matter the  
scroll position.

Hope this generates enough interest to answer some of these questions.
