From 6c16aa157725799950500fe2a0fecde9a1568b4d Mon Sep 17 00:00:00 2001 From: Jeff DePons Date: Sat, 6 Aug 2005 22:54:39 +0000 Subject: [PATCH] fixed bug causing menue to fail under xhtml transitional doc typeCVS: ---------------------------------------------------------------------- --- www/extras/slidePanel/slidePanel.js | 51 ++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/www/extras/slidePanel/slidePanel.js b/www/extras/slidePanel/slidePanel.js index a6af62e07..459f9d350 100644 --- a/www/extras/slidePanel/slidePanel.js +++ b/www/extras/slidePanel/slidePanel.js @@ -2,6 +2,7 @@ var panelButtonHeight = 23; var panelLinkTop = 25; + //create a crossbrowser layer object function createLayerObject(name) { this.name=name; @@ -29,7 +30,7 @@ function b_hide(){ //crossbrowser move absolute function b_moveTo(x,y){ - this.x = x; + this.x = x; this.y = y; this.css.left=x; this.css.top=y; @@ -71,18 +72,23 @@ function b_testScroll() { //scroll the panel content up function b_up(nr) { - this.ftop = this.ftop - 5; + + + this.ftop = this.ftop - 5; this.objf.style.top=this.ftop; - nr-- + //this.objf.style.zIndex=1; + nr-- if (nr>0) setTimeout(this.v+'.up('+nr+');',10); else this.testScroll(); } + + //scroll the panel content down function b_down(nr) { - this.ftop = this.ftop + 5; + this.ftop = this.ftop + 5; if (this.ftop>=panelLinkTop) { this.ftop=panelLinkTop; nr=0; @@ -207,7 +213,8 @@ function b_draw() { for (i=0;inr) { + //alert(nr); + if (i>nr) { this.panels[i].obj.style.top=this.height-((l-i)*panelButtonHeight)+"px"; } else { this.panels[i].obj.style.top=i*panelButtonHeight+"px"; @@ -264,12 +284,21 @@ function b_showPanel(nr) { } function createSlidePanelBar(name) { - this.aktPanel=0; // last open panel + //Added to allow support for xhtml transitional + var docElement = document.documentElement; + + if (document.compatMode == "BackCompat") { + docElement = document.body; + } + + + this.aktPanel=0; // last open panel this.name=name // name this.xpos=0; // bar x-pos this.ypos=0; // bar y-pos this.width=160; // bar width - this.height=((navigator.appVersion.indexOf("MSIE ") == -1)?innerHeight:document.body.offsetHeight)-10; // bar height + //this.height=((navigator.appVersion.indexOf("MSIE ") == -1)?innerHeight:document.body.offsetHeight)-10; // bar height + this.height=((navigator.appVersion.indexOf("MSIE ") == -1)?innerHeight:docElement.offsetHeight)-10; // bar height this.buttonspace=22 // distance of panel buttons this.panels=new Array() // panels this.addPanel=b_addPanel; // add new panel to bar