Results 1 to 5 of 5

Thread: AJAX TABS - Need Help

  1. #1
    Join Date
    Jan 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default AJAX TABS - Need Help

    I have THREE tabs: "title1", "title2", and "title3"

    How do I get "title1" to always be selected when the page loads or reloads?

    cript: DD Tab Menu
    http://www.dynamicdrive.com/dynamicindex1/ddtabmenu.htm



    Website: http://www.honestskin.com/home.htm


    Code:
    <div id="title">
    <div id="title1" class="title1" >
    <a href="conditions.htm" rel="4body"></a></div>
    <div id="title2" class="title2">
    <a href="types.htm" rel="4body"></a></div>
    <div id="title3" class="title3">
    <a href="brands.htm" rel="4body"></a></div>
    </div>
    
    
    <script type="text/javascript">
    var myflowers=new ddajaxtabs("title", "body4")
    myflowers.setpersist(true)
    myflowers.setselectedClassTarget("title1")
    myflowers.init()
    
    myflowers.onajaxpageload=function(pageurl){
    if (pageurl.indexOf("conditions.htm")!=-1){
    provinces=new ddajaxtabs("condside1", "condside2")
    provinces.setpersist(true)
    provinces.setselectedClassTarget("link")
    provinces.init()
    }
    else if (pageurl.indexOf("types.htm")!=-1){
    provinces=new ddajaxtabs("types1", "types2")
    provinces.setpersist(true)
    provinces.setselectedClassTarget("link")
    provinces.init()
    }
    
    else if (pageurl.indexOf("brands.htm")!=-1){
    provinces=new ddajaxtabs("brands1", "brands2")
    provinces.setpersist(true)
    provinces.setselectedClassTarget("link") //"link" or "linkparent"
    provinces.init()
    }}
    
    
    </script>

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

    Default

    Well, when you initialize your tabs, the second parameter in the function to call sets which tab should be selected by default:

    Code:
    <script type="text/javascript">
    //SYNTAX: ddtabmenu.definemenu("tab_menu_id", integer OR "auto")
    ddtabmenu.definemenu("ddtabs1", 0) //initialize Tab Menu with ID "ddtabs1" and select 1st tab by default
    </script>
    A value of 0 should translate into the first tab being selected when the page loads/ reloads.
    DD Admin

  3. #3
    Join Date
    Jan 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you, but I still can't get the script to pick "title" upon page load. What could I be doing wrong? This is placed in the head right?

    Code:
    <script type="text/javascript">
    myflowwers.definemenu("title", "0")
    </script>

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

    Default

    I'm confused actually. I assumed you were talking about DD Tab Menu from the link to the DD script in question, but your code snippet that followed corresponds to Ajax Tabs Content. Which one are you talking about?
    DD Admin

  5. #5
    Join Date
    Jan 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I obtained the script from: Ajax Tabs Content Script (v 2.2) on dynamicdrive.com.

    I'm sorry for the confusion.

    Can you still help?

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
  •