
Originally Posted by
whoami
thanks ddadmin!
what i meant is to have the similar effect to the yahoo's log in area(
www.yahoo.co.uk). when loading the page, no content displays, but when u click the tab or put the cursor over the tab, the external content is fetched and displayed.
Sure, that's possible as well. By default, the script will select the first tab and show its contents if no tabs have been explicitly given the class="selected" attribute. What you want then is to disable this behavior, so if no class="selected" attribute is present, then no tabs are selected nor content shown.
First, for your HTML, you'd simply set up the tabs to be all ajax fetched, with no tabs carrying class="selected". You'll also want to turn off persistence. In the end you'll have something like this:
Code:
<ul id="countrytabs" class="shadetabs">
<li><a href="external1.htm" rel="countrycontainer">Tab 1</a></li>
<li><a href="external2.htm" rel="countrycontainer">Tab 2</a></li>
<li><a href="external3.htm" rel="countrycontainer">Tab 3</a></li>
</ul>
<div id="countrydivcontainer" style="border:1px solid gray; width:450px; margin-bottom: 1em; padding: 10px">
</div>
<script type="text/javascript">
var countries=new ddajaxtabs("countrytabs", "countrydivcontainer")
countries.setpersist(false)
countries.setselectedClassTarget("link") //"link" or "linkparent"
countries.init()
</script>
Now, running the above will cause the 1st tab to be selected. To disable this auto select feature, inside the .js file, find the line:
Code:
if (persisterror) //if an error has occured while trying to retrieve persisted tab (based on its position within its peers)
and change that to:
Code:
if (this.enabletabpersistence && persisterror) //if an error has occured while trying to retrieve persisted tab (based on its position within its peers)
Now when you run the above example, no tabs are selected, and the content DIV is empty to begin with.
Bookmarks