Results 1 to 4 of 4

Thread: Tab Contect Script 2.2

  1. #1
    Join Date
    Apr 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Tab Contect Script 2.2

    1) Script Title: Tab Content Script (v 2.2)

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

    3) Describe problem:
    I have this script used to pull different users blogs onto 1 page.
    see http://hopenet.scottlaplanteproductions.com/blog2.asp

    my question...how can i get the whole script to be centered on the page, as opposed to left aligned?

    or would i be further ahead to just resize everything to fill the page?

    Thanks!
    sjl

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Centering the ouput shouldn't be a problem, as long as your tabs aren't floated "left' in the CSS. The first demo on the DD script page isn't, so to center the output is just a matter of some tweaks to the CSS. Note the changes in red:

    Code:
    <h3>Demo #1- Basic implementation</h3>
    
    <ul id="countrytabs" class="shadetabs" style="text-align:center">
    <li><a href="#" rel="country1" class="selected">Tab 1</a></li>
    <li><a href="#" rel="country2">Tab 2</a></li>
    <li><a href="#" rel="country3">Tab 3</a></li>
    <li><a href="#" rel="country4">Tab 4</a></li>
    <li><a href="http://www.dynamicdrive.com">Dynamic Drive</a></li>
    </ul>
    
    <div style="border:1px solid gray; width:450px; margin: 0 auto; padding: 10px">
    
    <div id="country1" class="tabcontent">
    Tab content 1 here<br />Tab content 1 here<br />
    </div>
    
    <div id="country2" class="tabcontent">
    Tab content 2 here<br />Tab content 2 here<br />
    </div>
    
    <div id="country3" class="tabcontent">
    Tab content 3 here<br />Tab content 3 here<br />
    </div>
    
    <div id="country4" class="tabcontent">
    Tab content 4 here<br />Tab content 4 here<br />
    </div>
    </div>

    <script type="text/javascript">

    var countries=new ddtabcontent("countrytabs")
    countries.setpersist(true)
    countries.setselectedClassTarget("link") //"link" or "linkparent"
    countries.init()

    </script>
    DD Admin

  3. #3
    Join Date
    Apr 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    This got the "content" part centered.....but it moved the tabs to the center as well. I'd like to keep those aligned left...

    thanks!

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    The first code in red above aligns the tabs, so if you don't want that, just remove that code.
    DD Admin

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
  •