Results 1 to 8 of 8

Thread: Stay on Top Content Script - Center?

  1. #1
    Join Date
    Jun 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Stay on Top Content Script - Center?

    1) Script Title: Stay On Top Content Script

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici.../stayontop.htm

    3) Describe problem:
    I cannot seem to get my div element to center itself on the page. I'm aware that there's 4 options to position the element based on the 4 corners of the window. However I'm hoping to be able to horizontally center it on the page and am wondering if there's a way to do this.

    I've tried using CSS position elements within the DIV tag when it's created, but the javascript positioning functions seem to override it.

    Please help

  2. #2
    Join Date
    Aug 2004
    Posts
    9,889
    Thanks
    3
    Thanked 964 Times in 953 Posts
    Blog Entries
    15

    Default

    Sure, try the following modified .js file. It adds a 5th orientation type that centers the DIV on the page. Just use a value of 5 below:

    Code:
    alwaysOnTop.init({
    	targetid: 'examplediv',
    	orientation: 5,
    	position: [5, 10],
    	fadeduration: [1000, 1000],
    	frequency: 0.95,
    	hideafter: 15000
    })
    DD Admin

  3. #3
    Join Date
    Jun 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    That actually worked perfectly once I 'commented' out the vertical positioning in the 'if' statement.

    Thanks for your help!

  4. #4
    Join Date
    Dec 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I would like to show ad to each user only once per 24h. I try to add "frequency: 1 day" or "frequency: 1 days" but it doesn't work.


    Thanks
    Last edited by kolenoblata; 12-03-2010 at 06:25 AM.

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,944
    Thanks
    43
    Thanked 3,193 Times in 3,156 Posts
    Blog Entries
    12

    Default

    That would be:

    Code:
    frequency: '1 days'
    Example:

    Code:
    alwaysOnTop.init({
    	targetid: 'examplediv',
    	orientation: 3,
    	position: [5, 10],
    	fadeduration: [1000, 1000],
    	frequency: '1 days',
    	hideafter: 15000
    })
    - John
    ________________________

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

  6. #6
    Join Date
    Dec 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Oh, yes, I forgot to add quotes

    Thanks

  7. #7
    Join Date
    May 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by ddadmin View Post
    Sure, try the following modified .js file. It adds a 5th orientation type that centers the DIV on the page. Just use a value of 5 below:

    Code:
    alwaysOnTop.init({
    	targetid: 'examplediv',
    	orientation: 5,
    	position: [5, 10],
    	fadeduration: [1000, 1000],
    	frequency: 0.95,
    	hideafter: 15000
    })
    This did not work for me. Anyone else know how to center it?

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,944
    Thanks
    43
    Thanked 3,193 Times in 3,156 Posts
    Blog Entries
    12

    Default

    This is an old thread. The script itself may have changed. Please start a new thread for a new question.

    But before doing so, make sure you are also using the modified script from ddadmin's post.
    - 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
  •