Results 1 to 2 of 2

Thread: How to use this ajaxtab?

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

    Smile How to use this ajaxtab?

    Hello there,

    I need help. this "ajaxtab" can't work when i change it into "linkparent"
    my code here:
    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml2/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=GB2312" />
    
    <link rel="stylesheet" type="text/css" href="http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/ajaxtabs/ajaxtabs.css" />
    
    <script type="text/javascript" src="http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/ajaxtabs/ajaxtabs.js">
    
    /***********************************************
    * Ajax Tabs Content script v2.2- ?Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    </script>
    
    </head>
    
    <body>
    <ul id="countrytabs" class="shadetabs">
    <li><a href="#" rel="tcontent1">Tab 1</a></li>
    <li><a href="#" rel="tcontent2">Tab 2</a></li>
    <li><a href="#" rel="tcontent3">Tab 3</a></li>
    <li><a href="#" rel="tcontent4">Tab 4</a></li>
    <li><a href="http://www.dynamicdrive.com">Dynamic Drive</a></li>
    </ul>
    
    <div id="tcontent1" class="tabcontent">
    content1
    </div>
    
    <div id="tcontent2" class="tabcontent">
    content2</div>
    
    <div id="tcontent3" class="tabcontent">
    content3
    </div>
    
    <div id="tcontent4" class="tabcontent">
    <a target="_blank" href="http:www.winrui.com">
    content4</a></div>
    
    </div>
    
    <script type="text/javascript">
    var countries=new ddajaxtabs("countrytabs", "tcontent1")
    var countries=new ddajaxtabs("countrytabs", "tcontent2")
    var countries=new ddajaxtabs("countrytabs", "tcontent3")
    var countries=new ddajaxtabs("countrytabs", "tcontent4")
    countries.setpersist(true)
    countries.setselectedClassTarget("linkparent") //"link" or "linkparent"
    countries.init()
    
    </script>
    
    </body>
    </html>
    who can help me ? I'm waiting for it online!
    sorry for my poor English!
    Many thanks
    Last edited by mingjaing; 10-17-2008 at 09:14 PM.

  2. #2
    Join Date
    Jul 2006
    Posts
    497
    Thanks
    8
    Thanked 70 Times in 70 Posts

    Default

    You're using that script in a wrong way. It retrieves content from the page specified in the selected link's href attribute and puts it in a predefined div. Your page assumes a totally different system based on the link's rel attribute which corresponds to the id of one out of several divs.

    Try one of these, particularly this one or this one.
    -- Chris
    informal JavaScript student of Douglas Crockford
    I like wikis - a lot.

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
  •