PDA

View Full Version : Centering Dropin Box



alleycat
08-08-2008, 07:58 PM
1) Script Title: Amazon style Drop-in content box

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/amazondrop.htm

3) Describe problem:

I would like to use this script but i need it to line up with another static element on the page which is always centered ( ie margin: 0 auto; )
Is there a way to do the same thing with javascript? Rather than having to enter exact coordinates.

Thanks in Advance

Andy

jscheuer1
08-09-2008, 02:08 PM
Yes, that's pretty easy to do in css, additions highlighted:


#dropinboxv2cover{
width: 320px; /*change width to desired */
height: 220px; /*change height to desired. REMOVE if you wish box to be content's natural height */
position:absolute; /*Don't change below 4 rules*/
z-index: 100;
overflow:hidden;
visibility: hidden;
left:50%!important;
margin-left:-160px;
}


Note: The margin-left value should be negative half the width value.