Results 1 to 2 of 2

Thread: Random Content Order script - non-repeating random content

  1. #1
    Join Date
    Apr 2006
    Posts
    6
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Random Content Order script - non-repeating random content

    1) Script Title: Random Content Order script

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

    3) Describe problem: I am using the this script to display text ads in my left navigation and my right navigation. My text ads are all in one include file. This file is included in my left and right nav. Let's say I have 6 ads. Since I have the ads include twice on the page, 6 ads show up on the left, and 6 ads show up on the right, and each ad is repeated twice. How can I modify this so that all 6 ads show up on the page, but only 3 in the left nav, and only 3 in the right, and they do not repeat? Or is this not possible, and it is better to have a separate include for the left and for the right nav, but even if I have two includes, how would you make sure all 6 ads are shown? Thank you.
    Last edited by doomeyes; 03-06-2008 at 06:49 PM.

  2. #2
    Join Date
    Aug 2004
    Posts
    9,918
    Thanks
    3
    Thanked 969 Times in 957 Posts
    Blog Entries
    15

    Default

    If all 6 ads are within one external file, and you wish to show 3 randomly on each column, what you can do is give the first 3 one particular CSS class name, and the other 3, a different one, so something like:

    Code:
    <div class="groupa">
    Content
    </div>
    
    <div class="groupa">
    Content
    </div>
    
    <div class="groupa">
    Content
    </div>
    
    <div class="groupb">
    Content
    </div>
    
    <div class="groupb">
    Content
    </div>
    
    <div class="groupb">
    Content
    </div>
    On the left column, somehow you will have to call:

    Code:
    <script type="text/javascript">
    
    randomizeContent("groupa")
    
    </script>
    And on the right column,

    Code:
    <script type="text/javascript">
    
    randomizeContent("groupb")
    
    </script>
    instead.

  3. The Following User Says Thank You to ddadmin For This Useful Post:

    doomeyes (03-07-2008)

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
  •