Log in

View Full Version : How to use this ajaxtab?



mingjaing
10-17-2008, 03:50 AM
Hello there,

I need help. this "ajaxtab" can't work when i change it into "linkparent"
my code here:

<!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

Jesdisciple
10-19-2008, 08:45 PM
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 (http://www.dynamicdrive.com/cgi-bin/search/search.cgi?zoom_query=tabs&zoom_per_page=10&zoom_and=1&zoom_sort=0), particularly this one (http://www.dynamicdrive.com/dynamicindex1/mouseovertabs.htm) or this one (http://www.dynamicdrive.com/dynamicindex1/ddtabmenu.htm).