Results 1 to 2 of 2

Thread: Centering Dropin Box

  1. #1
    Join Date
    Aug 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Centering Dropin Box

    1) Script Title: Amazon style Drop-in content box

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Yes, that's pretty easy to do in css, additions highlighted:

    Code:
    #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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •