From: Torbjorn T. <et...@us...> - 2005-10-04 20:50:26
|
Update of /cvsroot/jungerl/jungerl/lib/js/priv/docroot/Tabtastic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26709/priv/docroot/Tabtastic Modified Files: tabtastic.js Log Message: Index: tabtastic.js =================================================================== RCS file: /cvsroot/jungerl/jungerl/lib/js/priv/docroot/Tabtastic/tabtastic.js,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- tabtastic.js 30 Sep 2005 17:26:04 -0000 1.1 +++ tabtastic.js 4 Oct 2005 20:50:15 -0000 1.2 @@ -60,6 +60,7 @@ //*** 1.0.2 20040501 IE5Mac, IE6Win compat. //*** 1.0.3 20040501 Removed IE5Mac/Opera7 compat. (see http://phrogz.net/JS/Tabstatic/index.html#notes) //*** 1.0.4 20040521 Added scroll-back hack to prevent scrolling down to page anchor. Then commented out :) +//*** 1.0.5 20051004 Added workaround for bad scrolling behaviour. <to...@to...> AttachEvent(window,'load',function(){ var tocTag='ul',tocClass='tabset_tabs',tabTag='a',contentClass='tabset_content'; @@ -97,7 +98,7 @@ function Init(){ window.everyTabThereIsById = {}; - var anchorMatch = /#([a-z][\w.:-]*)$/i,match; + var anchorMatch = /([a-z][\w.:-]*)$/i,match; var activeTabs = []; var tocs = document.getElementsByTagName(tocTag); @@ -109,7 +110,7 @@ var tabs = toc.getElementsByTagName(tabTag); for (var j=0,len2=tabs.length;j<len2;j++){ var tab = tabs[j]; - if (!tab.href || !(match=anchorMatch.exec(tab.href))) continue; + if (!tab.name || !(match=anchorMatch.exec(tab.name))) continue; if (lastTab){ tab.prevTab=lastTab; lastTab.nextTab=tab; @@ -131,11 +132,11 @@ for (var i=0,len=document.links.length;i<len;i++){ var a = document.links[i]; - if (!(match=anchorMatch.exec(a.href))) continue; + if (!(match=anchorMatch.exec(a.name))) continue; if (a.semanticTab = everyTabThereIsById[match[1]]) AttachEvent(a,'click',SetTabFromAnchor,false); } - if ((match=anchorMatch.exec(location.href)) && (a=everyTabThereIsById[match[1]])) SetTabActive(a); + if ((match=anchorMatch.exec(location.name)) && (a=everyTabThereIsById[match[1]])) SetTabActive(a); } Init(); |