PDA

View Full Version : AJAX TABS - Class="selected" not working!



eriksnet
02-27-2009, 02:30 AM
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

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