barbapappa
01-30-2008, 05:49 PM
1) Script Title: Tab Content Script (v 2.0)
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm
3) Describe problem:
Hello!
I have installed and are trying to learn about the tab content script but I have a problem that I can't understand how to solve.
It's about which tab that should be default where the problem is.
I have changed from "link" to "linkparent" and the tab where I put class="selected" becomes default when I renew the page. So far so good.
But when I switch between tabs it doesn't happen anything with the tabs, only the content changes.
What have I done wrong?
It's a standard installation and the same problem in both IE and FF.
Many thanks in advance! :)
Edit:
I can tell that I use "tabcontent.js", "tabcontent.css" and the image files and than the following code:
(The place where I change from "link" to "linkparent" is in the javascript included at the end of the following code. Maybe that's wrong place to change and it should be in "tabcontent.js" instead?)
<html>
<head>
<link rel="stylesheet" type="text/css" href="tabcontent.css" />
<script type="text/javascript" src="tabcontent.js">
/***********************************************
* Tab Content script v2.0- © 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>
<h3>Demo #1- Basic implementation</h3>
<ul id="countrytabs" class="shadetabs">
<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-bottom: 1em; 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>
<p><b><a href="javascript: countries.expandit(3)">Click here to select last tab</a></b></p>
<hr />
</body>
</html>
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm
3) Describe problem:
Hello!
I have installed and are trying to learn about the tab content script but I have a problem that I can't understand how to solve.
It's about which tab that should be default where the problem is.
I have changed from "link" to "linkparent" and the tab where I put class="selected" becomes default when I renew the page. So far so good.
But when I switch between tabs it doesn't happen anything with the tabs, only the content changes.
What have I done wrong?
It's a standard installation and the same problem in both IE and FF.
Many thanks in advance! :)
Edit:
I can tell that I use "tabcontent.js", "tabcontent.css" and the image files and than the following code:
(The place where I change from "link" to "linkparent" is in the javascript included at the end of the following code. Maybe that's wrong place to change and it should be in "tabcontent.js" instead?)
<html>
<head>
<link rel="stylesheet" type="text/css" href="tabcontent.css" />
<script type="text/javascript" src="tabcontent.js">
/***********************************************
* Tab Content script v2.0- © 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>
<h3>Demo #1- Basic implementation</h3>
<ul id="countrytabs" class="shadetabs">
<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-bottom: 1em; 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>
<p><b><a href="javascript: countries.expandit(3)">Click here to select last tab</a></b></p>
<hr />
</body>
</html>