PDA

View Full Version : tabs counter



clshtml
10-13-2008, 09:52 AM
1) Script Title: Tab Content Script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm

3) Describe problem:
Hello,
on my page I have 7 tabs. But the number from the tabs are dynamic.
How I get with javascript the maximum number from the tabs?
maxTabs = 6

clshtml
10-13-2008, 04:02 PM
better question:
How I get the current number of tabs?

ddadmin
10-13-2008, 08:30 PM
Without knowing exactly what you're trying to accomplish, in general, you can get the number of tabs that toggle's a sub content within a script instance by probing the
instance.hottabspositions array's length:


<script type="text/javascript">

var countries=new ddtabcontent("countrytabs")
countries.setpersist(true)
countries.setselectedClassTarget("link") //"link" or "linkparent"
countries.init()

alert(countries.hottabspositions.length) //alerts 4

</script>