Firefox无法识别文本之间的javascript空格 [英] Firefox not recognising javascript spaces between text

查看:61
本文介绍了Firefox无法识别文本之间的javascript空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用foldoutmenu 3并且在查看我的菜单时遇到问题

在firefox中。在我的sub3菜单上,我在一些

的地方有多行文字。 firefox无法识别有多行

,文本只是重叠在它下面的子菜单。我以为我已经通过放置空的''垫片'来解决这个问题;


oFoldMenu.make(''sub3'','' '')// spacer


不幸的是,我刚刚在IExplorer中查看了该网站,它已经增加了太多的空间,因为它确实可以识别事实上,

首先有一行以上。


有什么方法可以让firefox识别额外的行

文字?有没有其他人有类似的问题?我可以在这里粘贴文字

是否有帮助。


我真的很感激任何帮助。

谢谢 - 蒂姆

I am using foldoutmenu 3 and am having problems with viewing my menus
in firefox. On my sub3 menus i have more than one line of text in some
places. firefox does not recognise that there is more than one line
and the text simply overlaps the sub-menus below it. I thought i had
got around this by placing empty ''spacers'' like so;

oFoldMenu.make(''sub3'','''')//spacer

unfortunately, i have just viewed the site in IExplorer and it has
added way too much space since it does in fact recognise the fact that
there is more than one line in the first place.

Is there some way i can make firefox recognise the extra lines of
text? Has anyone else had a similar problem? I can paste the text here
is it helps.

I''d really appreciate any help.
Thanks - tim

推荐答案

2月8日上午8:19,tim < timden ... @ gmail.comwrote:
On Feb 8, 8:19 am, "tim" <timden...@gmail.comwrote:

我正在使用foldoutmenu 3并且在查看我的菜单时遇到问题

in firefox 。在我的sub3菜单上,我在一些

的地方有多行文字。 firefox无法识别有多行

,文本只是重叠在它下面的子菜单。我以为我已经通过放置空的''垫片'来解决这个问题;


oFoldMenu.make(''sub3'','' '')// spacer


不幸的是,我刚刚在IExplorer中查看了该网站,它已经增加了太多的空间,因为它确实可以识别事实上,

首先有一行以上。


有什么方法可以让firefox识别额外的行

文字?有没有其他人有类似的问题?我可以在这里粘贴文字

是否有帮助。


我真的很感激任何帮助。

谢谢 - 蒂姆
I am using foldoutmenu 3 and am having problems with viewing my menus
in firefox. On my sub3 menus i have more than one line of text in some
places. firefox does not recognise that there is more than one line
and the text simply overlaps the sub-menus below it. I thought i had
got around this by placing empty ''spacers'' like so;

oFoldMenu.make(''sub3'','''')//spacer

unfortunately, i have just viewed the site in IExplorer and it has
added way too much space since it does in fact recognise the fact that
there is more than one line in the first place.

Is there some way i can make firefox recognise the extra lines of
text? Has anyone else had a similar problem? I can paste the text here
is it helps.

I''d really appreciate any help.
Thanks - tim



是的我需要代码或图片才能理解。


谢谢,

Adambrz
www.adambrz.com

Yeah I would need either the code or an image to understand.

Thanks,
Adambrz
www.adambrz.com


下面是代码,如果你在firefox中尝试它,即你会看到我的b $ b意味着什么。


谢谢你的期待。


Tim


< html>

< head>

< title>跨浏览器动态HTML脚本 - Foldoutmenu3< / title>

< style type =" text / css">


< / style>

< script type =" text / javascript" language =" JavaScript">

//默认浏览器检查,添加到所有脚本!

函数checkBrowser(){

this.ver = navigator.appVersion

this.dom = document.getElementById?1:0

this.ie5 =(this.ver.indexOf(" MSIE 5")> -1&& this.dom)?1:0;

this.ie4 =(document.all&&!this.dom)?1:0;

this.ns5 =(this.dom&& parseInt(this.ver)> = 5)?1:0;

this.ns4 =(document.layers&& ;!this.dom)?1:0;

this.bw =(this.ie5 || this.ie4 || this.ns4 || this.ns5)

返回此

}

bw =新checkBrowser()

/

******* ******************************************* ******* *******************************

制作跨浏览器对象

** ************************************************ ** ******************************** /

函数makeMenuObj(obj,nest,img, offimage,onimage){

nest =(!nest)? '''':''文件。''+ nest +''。''

this.css = bw.dom? document.getElementById(obj).style:bw.ie4?

document.all [obj] .style:bw.ns4?eval(nest +" document.layers。" + obj): 0;

this.el = bw.dom?document.getElementById(obj):bw.ie4?

document.all [obj]:bw.ns4?eval( nest +''document。''+ obj):0;

this.ref = bw.dom || bw.ie4? document:bw.ns4?this.css.document:0;

this.x =(bw.ns4 || bw.ns5)? this.css.left:this.css.offsetLeft;

this.y =(bw.ns4 || bw.ns5)? this.css.top:this.css.offsetTop;

this.height = bw.ns4?this.ref.height:this.el.offsetH 8;

this .hideIt = b_hideIt; this.showIt = b_showIt; this.movey = b_movey

this.status = 0;

this.swap = b_swap

if(onimage)this.onimage = onimage。 src

this.offimage = offimage

if(img)this.img = this.ref.images [img]

返回此

}

函数b_showIt(){this.css.visibility =" visible" ;; this.status = 1}

function b_hideIt(){this.css.visibility =" hidden" ;; this.status = 0}

函数b_movey(y){this.y = y; this.css.top = this.y}

函数b_swap(on){

if(this.onimage&& on){

this.img.src = this.onimage

}否则如果(this.onimage&&!on){

this.img.src = this。 offimage

}

}


/

********** **************************************** ********** ********************

制作菜单对象

************ ************************************** ************ ****************** /

function foldoutMenuObj(name){

this.menus = new Array()

this.name = name;

this.makeStyle = fold_style

this.make = fold_make

this.construct = fold_construct

this.fold = fold

this.foldstay = fold_stay

this.foldsub = fold_sub

this .foldsubstay = fold_sub_stay

this.foldsub2 = fold_sub2

this.foldsub2stay = fold_sub2_stay

this.foldsub3 = fold_sub3

this.foldsub3stay = fold_sub3_stay

this.foldsub4 = fold_sub4

this.foldsub4stay = fold_sub4_stay

this.placeAll = fold_placeAll;

this.menus = new Array()

this.a = 0; this.b; this.c; this.d; this.e; this.f

this.initexec =''''

this.opn = fold_opn;

}

/

***************************************** ********* ****************************** *

发起页面,制作物品..

************************************** ************ ****************************** /

function fold_construct(){

this.container = new makeMenuObj(''div''+ this.name +''Cont'')

this.menu = new Array ()

menuheight = 0;

for(i = 0; i< this.menus.length; i ++){

this.menu [i] = new makeMenuObj(''div''+ this.name + i,'div''+ this.name

+''Cont'',this.menus [i]。 img,this.menus [i] .offimage,this.menus [i] .onimage)

this.menu [i] .subs = this.menus [i] .subs

this.menu [i] .sub = new Array()

for(j = 0; j< this.menu [i] .subs; j ++){

this.menu [i] .sub [j] = new makeMenuObj(''div''+ this.name + i

+" _" + j,''div ''+ this.name +''续'',this.menus [i] [j] .img,this.menus [i]

[j] .offimage,this.menus [i] [j] .onimage)

this.menu [i] .sub [j] .subs = this.menus [i] [j] .subs

this.menu [i] .sub [j] .sub = new Array()

for(a = 0; a< this.menu [i] .sub [j] .subs; a ++){

this.menu [i] .sub [j] .sub [a] = new makeMenuObj(''div''+ this.name + i +" _" + j

+" _" + a,''div''+ this.name +''Cont'',this.menus [i] [j] [a] .img,this.menus [i] [j]

[a] .offimage,this.menus [i] [j] [a] .onimage)

this.menu [i] .sub [j] .sub [ a] .subs = this.menus [i] [j] [a] .subs

this.menu [i] .sub [j] .sub [a] .sub = new Array()

for(o = 0; o< this.menu [i] .sub [j] .sub [a] .subs; o ++){

this.menu [ i] .sub [j] .sub [a] .sub [o] = new makeMenuObj(''div''+ this.name + i

+" _" + j +" _" + a +" _" + o,''div''+ this.name +''Cont'',this.men us [i] [j] [a]

[o ] .IMG,this.menus [i] [j] [A] [O] .offimage,this.menu s [i] [j] [a]

[o] .onimage)

this.menu [i] .sub [j] .sub [a] .sub [o] .subs = this.menus [i] [j] [a] [o] .subs

this.menu [i] .sub [j] .sub [a] .sub [ o] .sub = new Array()

for(p = 0; p< this.menu [i] .sub [j] .sub [a] .sub [o] .subs; p ++ ){

this.menu [i] .sub [j] .sub [a] .sub [o] .sub [p] = new

makeMenuObj('' div''+ this.name + i +" _" + j +" _" + a +" _" + o +" _" + p,'div''+ this.name

+''续'',this.menus [i] [j] [a] [o] [p] .img,this.menus [i] [j] [a] [o]

[p] .offimage,this.menus [i] [j] [a] [o] [p] .onimage)

this.menu [i] .sub [j] .sub [a] .sub [o] .sub [p] .subs = this.menus [i] [j] [a] [o]

[p] .subs

this.menu [i] .sub [j] .sub [a] .sub [o] .sub [p] .sub = new Array()

for( z = 0; z< this.menu [i] .sub [j] .sub [a] .sub [o] .sub [p] .subs; z ++){

this.menu [我] .sub [j] .sub [a] .sub [o] .sub [p] .sub [z] = new

makeMenuObj(''div''+ this.name + i +" _" + j +" _" + a +" _" + o +" _&q uot; + p

+" _" + z,'div''+ this.name +''Cont'')

}

}

}

}

}

}

this.menus ="

if(this.initexec)eval(this.initexec)

else this.placeAll()

this.container .showIt()

}

函数fold_opn(a,b,c,d,e,f){

if(a> - 1)this.initexec + =" this.fold(" + a +"," + this.substay +");

if(b> -1)this.initexec + =" this.foldsub(" + a +"," + b +"," + this.su b2stay如果(c> -1)this.initexec + =" this.foldsub2(" + a +"," + b +","")" + c

+"," + this.sub3stay +");"

if(d> -1)this.initexec + =" this。 foldsub3(+ a +,+ b +,+ c +,+ d

+,+ this.sub4stay + ;);"

if(e> -1)this.initexec + =" this.foldsub4(" + a +"," + b +"," + c +"," + d +"," + e

+"," + this.sub5stay +");"

if (f> -1)this.initexec + =" this.foldsub5(" + a +"," + b +"," + c +"," + d +"," + e

+"," + f +"," + this.sub6stay +");"

}

/

************************************* *********** ****************************** *

第一个亚男人我们

***************************************** ********* ****************************** * /

function fold_stay (a){

for(z = 0; z< this.menu.length; z ++){

if(z!= a)this.fold(z, 1,1)

}

this.fold(a,1,0)

}

功能折叠(a,fromtop,noplace){

if(fromtop){

for(b = 0; b< this.menu [a] .subs; b ++){

if(this.menu [a] .sub [b] .status || noplace){

this.menu [a] .sub [b] .hideIt()

this.menu [a] .swap(0)

this.foldsub(a,b,1,1)

}否则{

this.menu [a] .sub [b] .showIt()

this.menu [a] .swap(1)

}

}

if(!noplace)this .placeAll()

}否则this.foldstay(a)

}

/

**** ********************************************** **** ************************** *

第二级子菜单

*** *********************************************** *** *************************** /

函数fold_sub_stay(a,b){

for(z = 0; z< this.menu [a] .subs; z ++){

if(b!= z)this.foldsub(a,z,1,1)

}

this.foldsub(a,b,1,0)

}

函数fold_sub(a, b,fromtop,noplace){

if(fromtop){

for(c = 0; c< this.menu [a] .sub [b] .subs; c ++){

if(this.menu [a] .sub [b] .sub [c] .status || noplace){

this.menu [a] .sub [b] .sub [c] .hideIt()

这个.menu [a] .sub [b] .swap(0)

this.foldsub2(a,b,c,1,1)

} else {

this.menu [a] .sub [b] .sub [c] .showIt()

this.menu [a] .sub [b] .swap(1)

}

}

if(!noplace)this.placeAll()

}否则this.foldsubstay( a,b)

}

/

******************** ****************************** ******************** **********

第三级子菜单

******************* ******************************* ******************* *********** /

函数fold_sub2_stay(a,b,c){

for(z = 0; z< this.menu [ a] .sub [b] .subs; z ++){

if(c!= z)this.foldsub2(a,b,z,1,1)

}

this.foldsub2(a,b,c,1,0)

}

函数fold_sub2(a,b,c,fromtop ,noplace){

if(fromtop){

for(d = 0; d< this.menu [a] .sub [b] .sub [c]。 subs; d ++){

if(this.menu [a] .sub [b] .sub [c] .sub [d] .status || noplace){

this.menu [a] .sub [b] .sub [c] .sub [d] .hideIt()

this.menu [a] .sub [b] .sub [c] .swap(0)

this.foldsub3(a,b,c,d,1,1)

} else {

this.menu [a] .sub [b] .sub [c] .sub [d] .showIt()

this.menu [a] .sub [ b] .sub [c] .swap(1)

}

}

if(!noplace)this.placeAll()

}否则this.foldsub2stay(a,b,c)

}

/

****** ******************************************** ****** ************************

第四级子菜单

***** ********************************************* ***** ************************* /

function fold_sub3_stay(a,b,c,d){

for(z = 0; z< this.menu [a] .sub [b] .sub [c] .subs; z ++){

if(z!= d)this .foldsub3(a,b,c,z,1,1)

}

this.foldsub3(a,b,c,d,1,0)

}

函数fold_sub3(a,b,c,d,fromtop,noplace){

if(fromtop){

for(e = 0; e< this.menu [a] .sub [b] .sub [c] .sub [d] .subs; e ++){

if(this.menu [a] .sub [b] .sub [c] .sub [d] .sub [e] .status || noplace){

this.menu [a] .sub [b] .sub [c] .sub [d] .sub [e] .hideIt()

this .menu [a] .sub [b] .sub [c] .sub [d] .swap(0)

this.foldsub4(a,b,c,d,e,1,1 )

}否则{

this.menu [a] .sub [b] .sub [c] .sub [d] .sub [e] .showIt()

this.menu [a] .sub [b] .sub [c] .sub [d] .swap(1)

}

}

if(!noplace)this.placeAll()

}否则this.foldsub3stay(a,b,c,d)

}

/

******************************** ****************** ****************************** />
第五级子菜单

******************************* ******************* ****************************** /

函数fold_sub4_stay(a,b,c,d,e){

for(z = 0; z< this.menu [a] .sub [b]。 sub [c] .sub [d] .subs; z ++){

if(z!= e)this.foldsub4(a,b,c,d,z,1,1)

}

this.foldsub4(a,b,c,d,e,1,0)

}

function fold_sub4(a,b,c,d,e,fromtop,noplace){

if(fromtop){

for(f = 0; f< this。 menu [a] .sub [b] .sub [c] .sub [d] .sub [e] .subs; f ++){

if(this.menu [a] .sub [b ] .sub [c] .sub [d] .sub [e] .sub [f] .status || noplace){

this.menu [a] .sub [b] .sub [c] .sub [d] .sub [e] .sub [f] .hideIt()

this.menu [a] .sub [b] .sub [c] .sub [d] .sub [e] .swap(0)

} else {

this.menu [a] .sub [b] .sub [c] .sub [d] .sub [e] .sub [f] .showIt()

this.menu [a] .sub [b] .sub [c] .sub [d] .sub [e] .swap(1)

}

}

if(!noplace)this.placeAll()

}否则this.foldsub4stay(a,b,c,d,e)

}

/

************************************ ************** ******************************

正确放置所有图层

************************************ ************** ****************************** /

函数fold_placeAll(){

menuheight = 0;

for(i = 0; i< this.menu.length; i ++){

this.menu [i] .movey(menuheight)

menuheight + = this.menu [i] .height + this.menubetween

for(j = 0; j< this.menu [i] .subs; j ++){

this.menu [i] .sub [j] .movey(menuheight)

if(this。菜单[I] .SUB [j]的.STATUS) menuheight + = this.menu [i] .sub [j] .height

+ this.menubetween

for(a = 0; a< this.menu [i]。 sub [j] .subs; a ++){

this.menu [i] .sub [j] .sub [a] .movey(menuheight)

if(this .menu [i] .sub [j] .sub [a] .status)menuheight

+ = this.menu [i] .sub [j] .sub [a] .height + this。 menubetween

for(o = 0; o< this.menu [i] .sub [j] .sub [a] .subs; o ++){

this.menu [i] .sub [j] .sub [a] .sub [o] .movey(menuheight)

if(this.menu [i] .sub [j] .sub [a]。 sub [o] .status)menuheight

+ = this.menu [i] .sub [j] .sub [a] .sub [o] .height + this.menubetween

for(p = 0; p< this.menu [i] .sub [j] .sub [a] .sub [o] .subs; p ++){

this.menu [我] .sub [j] .sub [a] .sub [o] .sub [p] .movey(menuheight)

if(this.menu [i] .sub [j] .sub [a] .sub [o] .sub [p] .status)menuheight

+ = this.menu [i] .sub [j] .sub [a] .sub [o] .sub [p] .height + this.menubetween

for(z = 0; z< this.menu [i] .sub [j] .sub [a] .sub [o] .sub [p ] .subs; z ++){

this.menu [i] .sub [j] .sub [a] .sub [o] .sub [p] .sub [z] .movey(m enuheight)

if(this.menu [i] .sub [j] .sub [a] .sub [o] .sub [p] .sub [z] .status)menuheight
+ = this.menu [i] .sub [j] .sub [a] .sub [o] .sub [p] .sub [z] .height

+ this .menubetween

}

}

}

}

}

}

}


/

************** ************************************ ************** ****************

写出图层的功能......应该在服务器端移动

*** *********************************************** *** ******************************* /

函数fold_style(){

str =''\ n< style type =" text / css"> \ n''

str + =''\ tDIV.cl''+ this.name + ''{位置:绝对的; ''+ this.clFold +'';

width:''+ this.width +'';身高:20} \ n''

str + =''\ tDIV.cl''+ this.name +''Sub {position:absolute; ''this.clSub

+'';身高:20;宽度: + this.width +; visibility:hidden} \ n''

str + =''\ tDIV.cl''+ this.name +''Sub2 {position:absolute; ''this.clSub2

+'';身高:20;宽度: + this.width +;能见度:隐藏} \ n''

str + =''\ tDIV.cl''+ this.name +''Sub3 {position:absolute; ''this.clSub3

+'';身高:20;宽度: + this.width +;可见性:隐藏} \ n''

str + =''\ tDIV.cl''+ this.name +''Sub4 {position:absolute; ''this.clSub4

+'';身高:20;宽度: + this.width +; visibility:hidden} \ n''

str + =''\ tDIV.cl''+ this.name +''Sub5 {position:absolute; ''this.clSub5

+'';身高:20;宽度: + this.width +;可见性:隐藏} \ n''

str + =''\ t#div''+ this.name +''Cont {''+ this.clCont +''; left:''+ this.left +'';

top:''+ this.top +'';高度: + this.maxheight +; width:''+ this.width +'';

visibility:hidden} \ n''

str + =''\ tA.cl''+ this。 name +''Links {''+ this.clFoldLinks +''} \ n''

str + =''\ tA.cl''+ this.name +''1Links {''+ this .clSubLinks +''} \ n''

str + =''\ tA.cl''+ this.name +''2Links {''+ this.clSub2Links +''} \ n ''

str + =''\ tA.cl''+ this.name +''3Links {''+ this.clSub3Links +''} \ n''

str + =''\ tA.cl''+ this.name +''4Links {''+ this.clSub4Links +''} \ n''

str + =''\ tA.cl''+ this.name +''5Links {''+ this.clSub5Links +''} \ n''

str + =''< / style> \ n \ n $ \\ n''

document.write(str)

}

函数fold_make_link(text,lnk,target,offimage,id, cl,ev,a cl){

str2 =''\t< div id =" div''+ id +''" class =" cl''+ cl +''">< a href ="''

if(lnk)str2 + = lnk +''" ''

else str2 + =''#" ''

if(!lnk || target){

str2 + =''onclick ="''+ ev +''; if(bw.ie5 || bw.ie4)this.blur()''

if(!target)str2 + ='';返回false''; str2 + =''"''

}

if(target)str2 + =''target ="''+ target +''"''; str2 + =''class =" cl''+ acl

+''Links">''

if(offimage)str2 + =''< img src = QUOT; '' + offimage + '' " name =" img''+ id +''"

border =" 0">''

str2 + = text +''< / a>< ; br>< / div> \ n''

返回str2

}


函数fold_make(类型,文字,lnk,target,offimage,onimage,fc,opn,end){

str ="" ; ?FC = FC FC +; '':'''';

if(!offimage)offimage ="" ;; if(!onimage)onimage =""

if(this.a == 0)str =''< div id =" div''+ this.name +''Cont" > \ n''

if(type ==" top"){

id = this.name + this.a

str + = fold_make_link(text,lnk,target,offimage,this。name

+ this.a,this.name,fc + this.name +''。fold(''+ this.a +' ',''+ this.name

+''。substay)'',this.name)

this.menus [this.a] = new Array()

this.menus [this.a] .subs = 0

if(onimage){this.menus [this.a] .onimage = new Image();

this.menus [this.a] .onimage.src = onimage;

this.menus [this.a] .offimage = offimage; this.menus [this.a] .img =''img''+ id}

this.a ++; this.b = 0; if(opn)this.opn(this.a)

} else if(type ==" sub"){

id = this.name +(this.a -1)+''_''+(this.b),this.name +''Sub''

str + = fold_make_link(text,lnk,target,offimage,id,th is.name + ''Sub'',fc

+ this.name +''。foldsub(''+(this.a-1)+'',''+(this.b)+'', ''+ this.name

+''。sub2stay)'',this.name +'''1')

if(opn)this.opn(this。 a-1,this.b)

this.menus [this.a-1] [this.b] = new Array()

if(onimage){this .menus [this.a-1] [this.b] .onimage = new Image();

this.menus [this.a-1] [this.b] .onimage.src = onimage; this.menus [this.a-1]

[this.b] .offimage = offimage; this.menus [this.a-1] [this.b] .img =''img''+ id}

this.b ++; this.menus [this.a-1] = .subs this.b; this.c = 0

}否则if(type ==" sub2"){

id = this.name +(this.a-1)+''_ ''+(this.b-1)+''_''+(this.c)

str + = fold_make_link(text,lnk,target,offimage,id,th is.name +'' Sub2'',fc

+ this.name +''。foldsub2(''+(this.a-1)+'',''+(this.b-1)+'', ''+(this.c)

+'',''+ this.name +''。sub3stay)'',this.name +'''''')

如果(opn)this.opn(this.a-1,this.b-1,this.c)

this.menus [this.a-1] [this.b-1] [this.c] = new Array()

if(onimage){this.menus [this.a-1] [this.b-1] [this.c] .onimage = new

Image(); this.menus [this.a-1] [this.b-1] [this.c] .onimage.src = onimage;

this.menus [this.a-1] [this。 b-1] [this.c] .offimage = offimage;

this.menus [this.a-1] [this.b-1] [this.c] .img =''img ''+ id}

this.c ++; this.menus [this.a-1] [this.b-1] = .subs this.c; this.d = 0

}否则if(type ==" sub3"){

id = this.name +(this.a-1)+''_ ''+(this.b-1)+''_''+(this.c-1)+''_''+(this.d)

str + = fold_make_link(text, lnk,target,offimage,id,th is.name +''Sub3'',fc

+ this.name +''。foldsub3(''+(this.a-1)+'', ''+(this.b-1)+'',''+

(this.c-1)+'',''+ this.d +'',''+ this。 name +''。sub4stay)'',this.name +'''3'')

if(opn)this.opn(this.a-1,this.b-1,this.c -1,this.d)

this.menus [this.a-1] [this.b-1] [this.c-1] [this.d] = new Array()

if(onimage){this.menus [this.a-1] [this.b-1] [this.c-1]

[this.d]。 onimage = new Image(); this.menus [this.a-1] [this.b-1] [this.c-1]

[this.d] .onimage.src = onimage; this.menus [this.a-1] [this.b-1] [this.c-1]

[this.d] .offimage = offimage; this.menus [this.a-1] [this.b-1] [this.c-1]

[this.d] .img =''img''+ id}

this.d ++; this.menus [this.a-1] [this.b-1] [this.c-1] .subs = this.d;

this.e = 0

} else if(type ==" sub4"){

id = this.name +(this.a-1)+''_''+(this.b-1)+ ''_''+(this.c-1)+''_''+

(this.d-1)+''_''+(this.e)

str + = fold_make_link(text,lnk,target,offimage,id,th is.name +''Sub4'',fc

+ this.name +''。foldsub4(''+ (this.a-1)+'',''+(this.b-1)+'',''+(this.c-1)+'',''+

(this.d-1)+'',''+ this.e +'',''+ this.name +''。sub5stay)'',this.name +'''4'')

if(opn)this.opn(this.a-1,this.b-1,this.c-1,this.d-1,this.e)

this.menus [ this.a-1] [this.b-1] [this.c-1] [this.d-1] [this.e] = new Array()

if(onimage){ this.menus [this.a-1] [this.b-1] [this.c-1] [this.d-1]

[this.e] .onimage = new Image( ); this.menus [this.a-1] [this.b-1] [this.c-1]

[this.d-1] [this.e] .onimage.src = onimage ; this.menus [this.a-1] [this.b-1]

[this.c-1] [this.d-1] [this.e] .offimage = offimage; this.menus [this.a-1]

[this.b-1] [this.c-1] [this.d-1] [this.e] .img =''img ''+ id}

this.e ++; this.menus [this.a-1] [this.b-1] [this.c-1]

[this.d-1] .subs = this.e; this.f = 0

}否则if(type ==" sub5"){

str + =''\ tt \ tt \ t< div id =" div''+ this.name +(this.a-1)+''_''+(this.b-1)+''_''+

(this.c -1)+ '' _ '' +(this.d-1)+ '' _ '' +(this.e-1)+ '' _ '' +(this.f)+ '' " <无线电通信/>
class =" cl''+ this.name +''Sub5">< a href ="''+ lnk +''" onclick ="''+ fc +''"

class =" cl''+ this.name +''5Links"''

if(target)str + =''target =" + target +"''

str + =''>''+ text +''< / a>< br>< / div> \ n''

if(opn)this.opn(this.a-1,this.b-1,this.c-1,this.d-1,this.e-1,this .f)

this.f ++; this.menus [this.a-1] [this.b-1] [this.c-1] [this.d-1]

[this.e-1] .subs = this .f

}

if(end)str + ="< / div>"

document.write(str)

}


< / script>

< / HEAD>

< BODY bgcolor = 白色>

< script type =" text / javascript" language =" JavaScript">

/

************************* ************************* ************************* *****

调用写入函数和设置变量

********************** **************************** ********************** ******** /

//要设置的变量


oFoldMenu = new foldoutMenuObj(''oFoldMenu'')

oFoldMenu.substay = false //子菜单是否应保持折叠状态?

oFoldMenu.sub2stay = false // sub2菜单是否保持折叠状态?

oFoldMenu.sub3stay = false // sub3菜单是否保持折叠状态?

oFoldMenu.sub4stay = false // sub4菜单是否保持折叠?

oFoldMenu.sub5stay = false //应该sub5菜单保持折叠状态?

oFoldMenu.sub6stay = false // sub6菜单是否应该折叠?


oFoldMenu.menubetween = 5 //之间的像素值折叠菜单

oFoldMenu.left = 80 //菜单的左侧位置

oFoldMen u.top = 100 //菜单的顶部位置

oFoldMenu.width = 420 //菜单的宽度

oFoldMenu.maxheight = 2000 //最大高度菜单,一定要设置

这个足够高


//设置样式

oFoldMenu.clFold =" " // topDivs的常规样式

oFoldMenu.clSub =" left:10" // subDivs的样式

oFoldMenu.clSub2 =" left:20" // sub2Divs的样式

oFoldMenu.clSub3 =" left:30" // sub3Divs的样式

oFoldMenu.clSub4 =" left:40" // sub4Divs的样式

oFoldMenu.clSub5 =" left:60" // sub5Divs的样式


oFoldMenu.clCont =" position:absolute;" // cont图层,设置位置

如果你想尝试将它放在一个图层或其他任何内容中

oFoldMenu.clFoldLinks =" font-family:Arial ,Helvetica; font-size:11px;

text-decoration:none;字体重量:正常;颜色:#663300" //顶部链接的样式



oFoldMenu.clSubLinks =" font-family:Arial,Helvetica; font-size:11px;

font-weight:normal;文字修饰:无;颜色:#999900" //子链接的样式



oFoldMenu.clSub2Links =" font-family:Arial,Helvetica; font-size:11px;

text-decoration:none;颜色:#CC6699" // sub2links的样式

oFoldMenu.clSub3Links =" font-family:Arial,Helvetica; font-size:11px;

text-decoration:none;颜色:#66CC33" // sub3links的样式

oFoldMenu.clSub4Links =" font-family:Arial,Helvetica; font-size:11px;

text-decoration:none;颜色:#66CC33" // sub4links的样式

oFoldMenu.clSub5Links =" font-family:Arial,Helvetica; font-size:10px;

text-decoration:none;颜色:#66CC33" // sub5links的风格


//不要改变这一行!

oFoldMenu.makeStyle()

//制作菜单


/ * ARGUMENTS:

type =此项目的菜单类型(top,sub,sub2,sub3,sub4,sub5)

text =项目的文字

lnk =项目的链接(子菜单时不需要)

target =链接的目标(如果没有目标或没有链接则不需要)

offimage =默认的箭头这个元素的图像(如果你指定

没有文字,你只能使用图像)

onimage =点击时交换的图像(如果你没有,则不需要) '$

想要一张交换图片)

fc =如果你想让这个项目执行另一个javascript函数

还要用这个

opn =如果你想在负载设置上打开这个特定项目这个

到1(0,1)

* /


// MAIN 1

oFoldMenu.make(''top'',''FURNITURE'',0,0,''images / arrow.gif'',''图片/

arrow1.gif'')

oFoldMenu.make(''sub'',''not working'','0,0,''images / arrow .gif'','''images /

arrow1.gif'')

oFoldMenu.make(''sub2'',''这里是重叠的文字当使用firefox时,菜单下面是
。如果我使用的是Internet Explorer,这个工作就好了。请帮忙,我们将非常感激。这里是文字

那个当使用Firefox时,它与下面的菜单重叠。如果我使用

Internet explorer,这个工作正常。请帮助,这将是非常好的

赞赏。当使用firefox时,文本与它下面的菜单重叠

。如果我使用互联网资源管理器,这工作正常。

请帮助,非常感谢。这是使用firefox时它下面的菜单重叠的文本

。如果我使用互联网

资源管理器,这很好用。请帮助,这将是非常值得赞赏的。 '')

oFoldMenu.make(''sub2'',''another'',''http://www.3pc.com/

index.html '','''',''images/arrow.gif'',''images/arrow1.gif'')

oFoldMenu.make(''sub2'',''yet another '',''http://www.abundanttech.com/

index.html'','''',''images/arrow.gif'',''images/arrow1. gif'')


//MAIN 2

oFoldMenu.make(''top'',''OBJECT'',0,0,'' images/arrow.gif'',''images/

arrow1.gif'')

oFoldMenu.make(''sub'',''Arts & Humanities '',0,0,''images/

arrow.gif'',''images/arrow1.gif'')

oFoldMenu.make(''sub2 '',''Art History'',0,0,''images/arrow.gif'',''images/

arrow1.gif'')

oFoldMenu.make(''sub3'',''Architectural History'',0,0,''images/

arrow.gif'',''images/arrow 1.gif’’)

oFoldMenu.make(’’sub4’’,’’Architects’’,0,0,’’images/arrow.gif’’,’’images/

arrow1.gif’’)

oFoldMenu.make(’’sub2’’,’’Arts Therapy’’,’’http://www.3pc.com’’,’’_blank’’)

oFoldMenu.make(’’sub2’’,’’Awards’’,’’http://www.3pc.com’’,’’_blank’’)

oFoldMenu.make(’’sub2’’,’’Booksellers’’,’’http://www.3pc.com’’,’’_blank’’)

oFoldMenu.make(’’sub2’’,’’Censorship’’,’’http://www.3pc.com’’,’’_blank’’)

oFoldMenu.make(’’sub2’’,’’Chats and Forums’’,0,0,0,0,0,0,1)

function start(){

oFoldMenu.construct()

}


onload=start;


</script>


not working properly - click on furniture and not working to see the

text that overlaps the buttons.

</BODY >

</HTML>
Heres the code, if you try it in firefox and ie you''ll see what i
mean.

Thanks for looking.

Tim

<html>
<head>
<title>Cross-browser Dynamic HTML Scripts - Foldoutmenu3</title>
<style type="text/css">

</style>
<script type="text/javascript" language="JavaScript">
//Default browsercheck, added to all scripts!
function checkBrowser(){
this.ver=navigator.appVersion
this.dom=document.getElementById?1:0
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
this.ie4=(document.all && !this.dom)?1:0;
this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
return this
}
bw=new checkBrowser()
/
************************************************** **********************************
Making cross-browser objects
************************************************** **********************************/
function makeMenuObj(obj,nest,img,offimage,onimage){
nest=(!nest) ? '''':''document.''+nest+''.''
this.css=bw.dom? document.getElementById(obj).style:bw.ie4?
document.all[obj].style:bw.ns4?eval(nest+"document.layers." +obj):0;
this.el=bw.dom?document.getElementById(obj):bw.ie4 ?
document.all[obj]:bw.ns4?eval(nest+''document.''+obj):0;
this.ref=bw.dom || bw.ie4? document:bw.ns4?this.css.document:0;
this.x=(bw.ns4 || bw.ns5)? this.css.left:this.css.offsetLeft;
this.y=(bw.ns4 || bw.ns5)? this.css.top:this.css.offsetTop;
this.height=bw.ns4?this.ref.height:this.el.offsetH eight;
this.hideIt=b_hideIt; this.showIt=b_showIt; this.movey=b_movey
this.status=0;
this.swap=b_swap
if(onimage)this.onimage=onimage.src
this.offimage=offimage
if(img)this.img=this.ref.images[img]
return this
}
function b_showIt(){this.css.visibility="visible"; this.status=1}
function b_hideIt(){this.css.visibility="hidden"; this.status=0}
function b_movey(y){this.y=y; this.css.top=this.y}
function b_swap(on){
if(this.onimage && on){
this.img.src=this.onimage
}else if(this.onimage && !on){
this.img.src=this.offimage
}
}

/
************************************************** ******************************
Making menuobjects
************************************************** ******************************/
function foldoutMenuObj(name){
this.menus=new Array()
this.name=name;
this.makeStyle=fold_style
this.make=fold_make
this.construct=fold_construct
this.fold=fold
this.foldstay=fold_stay
this.foldsub=fold_sub
this.foldsubstay=fold_sub_stay
this.foldsub2=fold_sub2
this.foldsub2stay=fold_sub2_stay
this.foldsub3=fold_sub3
this.foldsub3stay=fold_sub3_stay
this.foldsub4=fold_sub4
this.foldsub4stay=fold_sub4_stay
this.placeAll=fold_placeAll;
this.menus=new Array()
this.a=0; this.b; this.c; this.d; this.e; this.f
this.initexec=''''
this.opn=fold_opn;
}
/
************************************************** ******************************
Initiating page, making objects..
************************************************** ******************************/
function fold_construct(){
this.container=new makeMenuObj(''div''+this.name+''Cont'')
this.menu=new Array()
menuheight=0;
for(i=0;i<this.menus.length;i++){
this.menu[i]=new makeMenuObj(''div''+this.name+i,''div''+this.name
+''Cont'',this.menus[i].img,this.menus[i].offimage,this.menus[i].onimage)
this.menu[i].subs=this.menus[i].subs
this.menu[i].sub=new Array()
for(j=0;j<this.menu[i].subs;j++){
this.menu[i].sub[j]=new makeMenuObj(''div''+this.name+i
+"_"+j,''div''+this.name+''Cont'',this.menus[i][j].img,this.menus[i]
[j].offimage,this.menus[i][j].onimage)
this.menu[i].sub[j].subs=this.menus[i][j].subs
this.menu[i].sub[j].sub=new Array()
for(a=0;a<this.menu[i].sub[j].subs;a++){
this.menu[i].sub[j].sub[a]=new makeMenuObj(''div''+this.name+i+"_"+j
+"_"+a,''div''+this.name+''Cont'',this.menus[i][j][a].img,this.menus[i][j]
[a].offimage,this.menus[i][j][a].onimage)
this.menu[i].sub[j].sub[a].subs=this.menus[i][j][a].subs
this.menu[i].sub[j].sub[a].sub=new Array()
for(o=0;o<this.menu[i].sub[j].sub[a].subs;o++){
this.menu[i].sub[j].sub[a].sub[o]=new makeMenuObj(''div''+this.name+i
+"_"+j+"_"+a+"_"+o,''div''+this.name+''Cont'',this.men us[i][j][a]
[o].img,this.menus[i][j][a][o].offimage,this.menus[i][j][a]
[o].onimage)
this.menu[i].sub[j].sub[a].sub[o].subs=this.menus[i][j][a][o].subs
this.menu[i].sub[j].sub[a].sub[o].sub=new Array()
for(p=0;p<this.menu[i].sub[j].sub[a].sub[o].subs;p++){
this.menu[i].sub[j].sub[a].sub[o].sub[p]=new
makeMenuObj(''div''+this.name+i+"_"+j+"_"+a+"_"+o+"_ "+p,''div''+this.name
+''Cont'',this.menus[i][j][a][o][p].img,this.menus[i][j][a][o]
[p].offimage,this.menus[i][j][a][o][p].onimage)
this.menu[i].sub[j].sub[a].sub[o].sub[p].subs=this.menus[i][j][a][o]
[p].subs
this.menu[i].sub[j].sub[a].sub[o].sub[p].sub=new Array()
for(z=0;z<this.menu[i].sub[j].sub[a].sub[o].sub[p].subs;z++){
this.menu[i].sub[j].sub[a].sub[o].sub[p].sub[z]=new
makeMenuObj(''div''+this.name+i+"_"+j+"_"+a+"_"+o+"_ "+p
+"_"+z,''div''+this.name+''Cont'')
}
}
}
}
}
}
this.menus=""
if(this.initexec) eval(this.initexec)
else this.placeAll()
this.container.showIt()
}
function fold_opn(a,b,c,d,e,f){
if(a>-1) this.initexec+="this.fold("+a+","+this.substay+"); "
if(b>-1) this.initexec+="this.foldsub("+a+","+b+","+this.su b2stay+");"
if(c>-1) this.initexec+="this.foldsub2("+a+","+b+","+c
+","+this.sub3stay+");"
if(d>-1) this.initexec+="this.foldsub3("+a+","+b+","+c+","+ d
+","+this.sub4stay+");"
if(e>-1) this.initexec+="this.foldsub4("+a+","+b+","+c+","+ d+","+e
+","+this.sub5stay+");"
if(f>-1) this.initexec+="this.foldsub5("+a+","+b+","+c+","+ d+","+e
+","+f+","+this.sub6stay+");"
}
/
************************************************** ******************************
The first sub menus
************************************************** ******************************/
function fold_stay(a){
for(z=0;z<this.menu.length;z++){
if(z!=a) this.fold(z,1,1)
}
this.fold(a,1,0)
}
function fold(a,fromtop,noplace){
if(fromtop){
for(b=0;b<this.menu[a].subs;b++){
if(this.menu[a].sub[b].status || noplace){
this.menu[a].sub[b].hideIt()
this.menu[a].swap(0)
this.foldsub(a,b,1,1)
}else{
this.menu[a].sub[b].showIt()
this.menu[a].swap(1)
}
}
if(!noplace) this.placeAll()
}else this.foldstay(a)
}
/
************************************************** ******************************
The second sub level menus
************************************************** ******************************/
function fold_sub_stay(a,b){
for(z=0;z<this.menu[a].subs;z++){
if(b!=z) this.foldsub(a,z,1,1)
}
this.foldsub(a,b,1,0)
}
function fold_sub(a,b,fromtop,noplace){
if(fromtop){
for(c=0;c<this.menu[a].sub[b].subs;c++){
if(this.menu[a].sub[b].sub[c].status || noplace){
this.menu[a].sub[b].sub[c].hideIt()
this.menu[a].sub[b].swap(0)
this.foldsub2(a,b,c,1,1)
}else{
this.menu[a].sub[b].sub[c].showIt()
this.menu[a].sub[b].swap(1)
}
}
if(!noplace) this.placeAll()
}else this.foldsubstay(a,b)
}
/
************************************************** ******************************
The third sub level menus
************************************************** ******************************/
function fold_sub2_stay(a,b,c){
for(z=0;z<this.menu[a].sub[b].subs;z++){
if(c!=z) this.foldsub2(a,b,z,1,1)
}
this.foldsub2(a,b,c,1,0)
}
function fold_sub2(a,b,c,fromtop,noplace){
if(fromtop){
for(d=0;d<this.menu[a].sub[b].sub[c].subs;d++){
if(this.menu[a].sub[b].sub[c].sub[d].status || noplace){
this.menu[a].sub[b].sub[c].sub[d].hideIt()
this.menu[a].sub[b].sub[c].swap(0)
this.foldsub3(a,b,c,d,1,1)
}else{
this.menu[a].sub[b].sub[c].sub[d].showIt()
this.menu[a].sub[b].sub[c].swap(1)
}
}
if(!noplace) this.placeAll()
}else this.foldsub2stay(a,b,c)
}
/
************************************************** ******************************
The fourth sub level menus
************************************************** ******************************/
function fold_sub3_stay(a,b,c,d){
for(z=0;z<this.menu[a].sub[b].sub[c].subs;z++){
if(z!=d) this.foldsub3(a,b,c,z,1,1)
}
this.foldsub3(a,b,c,d,1,0)
}
function fold_sub3(a,b,c,d,fromtop,noplace){
if(fromtop){
for(e=0;e<this.menu[a].sub[b].sub[c].sub[d].subs;e++){
if(this.menu[a].sub[b].sub[c].sub[d].sub[e].status || noplace){
this.menu[a].sub[b].sub[c].sub[d].sub[e].hideIt()
this.menu[a].sub[b].sub[c].sub[d].swap(0)
this.foldsub4(a,b,c,d,e,1,1)
}else{
this.menu[a].sub[b].sub[c].sub[d].sub[e].showIt()
this.menu[a].sub[b].sub[c].sub[d].swap(1)
}
}
if(!noplace) this.placeAll()
}else this.foldsub3stay(a,b,c,d)
}
/
************************************************** ******************************
The fifth sub level menus
************************************************** ******************************/
function fold_sub4_stay(a,b,c,d,e){
for(z=0;z<this.menu[a].sub[b].sub[c].sub[d].subs;z++){
if(z!=e) this.foldsub4(a,b,c,d,z,1,1)
}
this.foldsub4(a,b,c,d,e,1,0)
}
function fold_sub4(a,b,c,d,e,fromtop,noplace){
if(fromtop){
for(f=0;f<this.menu[a].sub[b].sub[c].sub[d].sub[e].subs;f++){
if(this.menu[a].sub[b].sub[c].sub[d].sub[e].sub[f].status || noplace){
this.menu[a].sub[b].sub[c].sub[d].sub[e].sub[f].hideIt()
this.menu[a].sub[b].sub[c].sub[d].sub[e].swap(0)
}else{
this.menu[a].sub[b].sub[c].sub[d].sub[e].sub[f].showIt()
this.menu[a].sub[b].sub[c].sub[d].sub[e].swap(1)
}
}
if(!noplace) this.placeAll()
}else this.foldsub4stay(a,b,c,d,e)
}
/
************************************************** ******************************
Placing all layers correctly
************************************************** ******************************/
function fold_placeAll(){
menuheight=0;
for(i=0;i<this.menu.length;i++){
this.menu[i].movey(menuheight)
menuheight+=this.menu[i].height+this.menubetween
for(j=0;j<this.menu[i].subs;j++){
this.menu[i].sub[j].movey(menuheight)
if(this.menu[i].sub[j].status) menuheight+=this.menu[i].sub[j].height
+this.menubetween
for(a=0;a<this.menu[i].sub[j].subs;a++){
this.menu[i].sub[j].sub[a].movey(menuheight)
if(this.menu[i].sub[j].sub[a].status) menuheight
+=this.menu[i].sub[j].sub[a].height+this.menubetween
for(o=0;o<this.menu[i].sub[j].sub[a].subs;o++){
this.menu[i].sub[j].sub[a].sub[o].movey(menuheight)
if(this.menu[i].sub[j].sub[a].sub[o].status) menuheight
+=this.menu[i].sub[j].sub[a].sub[o].height+this.menubetween
for(p=0;p<this.menu[i].sub[j].sub[a].sub[o].subs;p++){
this.menu[i].sub[j].sub[a].sub[o].sub[p].movey(menuheight)
if(this.menu[i].sub[j].sub[a].sub[o].sub[p].status) menuheight
+=this.menu[i].sub[j].sub[a].sub[o].sub[p].height+this.menubetween
for(z=0;z<this.menu[i].sub[j].sub[a].sub[o].sub[p].subs;z++){
this.menu[i].sub[j].sub[a].sub[o].sub[p].sub[z].movey(menuheight)
if(this.menu[i].sub[j].sub[a].sub[o].sub[p].sub[z].status) menuheight
+=this.menu[i].sub[j].sub[a].sub[o].sub[p].sub[z].height
+this.menubetween
}
}
}
}
}
}
}

/
************************************************** ******************************
Functions to write out the layers...Should be moved server-side
************************************************** ******************************/

function fold_style(){
str=''\n<style type="text/css">\n''
str+=''\tDIV.cl''+this.name+''{position:absolute; ''+ this.clFold +'';
width:''+this.width+''; height:20}\n''
str+=''\tDIV.cl''+this.name+''Sub{position:absolute; ''+ this.clSub
+'';height:20; width:''+this.width+''; visibility:hidden}\n''
str+=''\tDIV.cl''+this.name+''Sub2{position:absolute; ''+ this.clSub2
+'';height:20; width:''+this.width+''; visibility:hidden}\n''
str+=''\tDIV.cl''+this.name+''Sub3{position:absolute; ''+ this.clSub3
+'';height:20; width:''+this.width+''; visibility:hidden}\n''
str+=''\tDIV.cl''+this.name+''Sub4{position:absolute; ''+ this.clSub4
+'';height:20; width:''+this.width+''; visibility:hidden}\n''
str+=''\tDIV.cl''+this.name+''Sub5{position:absolute; ''+ this.clSub5
+'';height:20; width:''+this.width+''; visibility:hidden}\n''
str+=''\t#div''+this.name+''Cont{''+this.clCont+''; left:''+this.left+'';
top:''+this.top+''; height:''+this.maxheight+''; width:''+this.width+'';
visibility:hidden}\n''
str+=''\tA.cl''+this.name+''Links{''+this.clFoldLinks+ ''}\n''
str+=''\tA.cl''+this.name+''1Links{''+this.clSubLinks+ ''}\n''
str+=''\tA.cl''+this.name+''2Links{''+this.clSub2Links +''}\n''
str+=''\tA.cl''+this.name+''3Links{''+this.clSub3Links +''}\n''
str+=''\tA.cl''+this.name+''4Links{''+this.clSub4Links +''}\n''
str+=''\tA.cl''+this.name+''5Links{''+this.clSub5Links +''}\n''
str+=''</style>\n\n\n''
document.write(str)
}
function fold_make_link(text,lnk,target,offimage,id,cl,ev,a cl){
str2=''\t<div id="div''+id+''" class="cl''+cl+''"><a href="''
if(lnk) str2+=lnk+''" ''
else str2+=''#" ''
if(!lnk || target){
str2+=''onclick="''+ev+''; if(bw.ie5 || bw.ie4) this.blur()''
if(!target) str2+=''; return false''; str2+=''"''
}
if(target) str2+='' target="''+target+''"''; str2+='' class="cl''+acl
+''Links">''
if(offimage) str2+=''<img src="''+offimage+''" name="img''+id+''"
border="0">''
str2+=text+''</a><br></div>\n''
return str2
}

function fold_make(type,text,lnk,target,offimage,onimage,fc ,opn,end){
str="" ; fc=fc?fc+''; '':'''';
if(!offimage) offimage=""; if(!onimage) onimage=""
if(this.a==0) str=''<div id="div''+this.name+''Cont">\n''
if(type=="top"){
id=this.name+this.a
str+=fold_make_link(text,lnk,target,offimage,this. name
+this.a,this.name,fc+this.name+''.fold(''+this.a+'','' +this.name
+''.substay)'',this.name)
this.menus[this.a]=new Array()
this.menus[this.a].subs=0
if(onimage){ this.menus[this.a].onimage=new Image();
this.menus[this.a].onimage.src=onimage;
this.menus[this.a].offimage=offimage; this.menus[this.a].img=''img''+id}
this.a++; this.b=0; if(opn) this.opn(this.a)
}else if(type=="sub"){
id=this.name+(this.a-1)+''_''+(this.b),this.name+''Sub''
str+=fold_make_link(text,lnk,target,offimage,id,th is.name+''Sub'',fc
+this.name+''.foldsub(''+(this.a-1)+'',''+(this.b)+'',''+this.name
+''.sub2stay)'',this.name+''1'')
if(opn) this.opn(this.a-1,this.b)
this.menus[this.a-1][this.b]=new Array()
if(onimage){ this.menus[this.a-1][this.b].onimage=new Image();
this.menus[this.a-1][this.b].onimage.src=onimage; this.menus[this.a-1]
[this.b].offimage=offimage; this.menus[this.a-1][this.b].img=''img''+id}
this.b++; this.menus[this.a-1].subs=this.b; this.c=0
}else if(type=="sub2"){
id=this.name+(this.a-1)+''_''+(this.b-1)+''_''+(this.c)
str+=fold_make_link(text,lnk,target,offimage,id,th is.name+''Sub2'',fc
+this.name+''.foldsub2(''+(this.a-1)+'',''+(this.b-1)+'',''+(this.c)
+'',''+this.name+''.sub3stay)'',this.name+''2'')
if(opn) this.opn(this.a-1,this.b-1,this.c)
this.menus[this.a-1][this.b-1][this.c]=new Array()
if(onimage){ this.menus[this.a-1][this.b-1][this.c].onimage=new
Image(); this.menus[this.a-1][this.b-1][this.c].onimage.src=onimage;
this.menus[this.a-1][this.b-1][this.c].offimage=offimage;
this.menus[this.a-1][this.b-1][this.c].img=''img''+id}
this.c++; this.menus[this.a-1][this.b-1].subs=this.c; this.d=0
}else if(type=="sub3"){
id=this.name+(this.a-1)+''_''+(this.b-1)+''_''+(this.c-1)+''_''+(this.d)
str+=fold_make_link(text,lnk,target,offimage,id,th is.name+''Sub3'',fc
+this.name+''.foldsub3(''+(this.a-1)+'',''+(this.b-1)+'',''+
(this.c-1)+'',''+this.d+'',''+this.name+''.sub4stay)'',this.name +''3'')
if(opn) this.opn(this.a-1,this.b-1,this.c-1,this.d)
this.menus[this.a-1][this.b-1][this.c-1][this.d]=new Array()
if(onimage){ this.menus[this.a-1][this.b-1][this.c-1]
[this.d].onimage=new Image(); this.menus[this.a-1][this.b-1][this.c-1]
[this.d].onimage.src=onimage; this.menus[this.a-1][this.b-1][this.c-1]
[this.d].offimage=offimage; this.menus[this.a-1][this.b-1][this.c-1]
[this.d].img=''img''+id}
this.d++; this.menus[this.a-1][this.b-1][this.c-1].subs=this.d;
this.e=0
}else if(type=="sub4"){
id=this.name+(this.a-1)+''_''+(this.b-1)+''_''+(this.c-1)+''_''+
(this.d-1)+''_''+(this.e)
str+=fold_make_link(text,lnk,target,offimage,id,th is.name+''Sub4'',fc
+this.name+''.foldsub4(''+(this.a-1)+'',''+(this.b-1)+'',''+(this.c-1)+'',''+
(this.d-1)+'',''+this.e+'',''+this.name+''.sub5stay)'',this.name +''4'')
if(opn) this.opn(this.a-1,this.b-1,this.c-1,this.d-1,this.e)
this.menus[this.a-1][this.b-1][this.c-1][this.d-1][this.e]=new Array()
if(onimage){ this.menus[this.a-1][this.b-1][this.c-1][this.d-1]
[this.e].onimage=new Image(); this.menus[this.a-1][this.b-1][this.c-1]
[this.d-1][this.e].onimage.src=onimage; this.menus[this.a-1][this.b-1]
[this.c-1][this.d-1][this.e].offimage=offimage; this.menus[this.a-1]
[this.b-1][this.c-1][this.d-1][this.e].img=''img''+id}
this.e++; this.menus[this.a-1][this.b-1][this.c-1]
[this.d-1].subs=this.e; this.f=0
}else if(type=="sub5"){
str+=''\t\t\t<div id="div''+this.name+(this.a-1)+''_''+(this.b-1)+''_''+
(this.c-1)+''_''+(this.d-1)+''_''+(this.e-1)+''_''+(this.f)+''"
class="cl''+this.name+''Sub5"><a href="''+lnk+''" onclick="''+fc+''"
class="cl''+this.name+''5Links"''
if(target) str+='' target="+target+"''
str+=''>''+text+''</a><br></div>\n''
if(opn) this.opn(this.a-1,this.b-1,this.c-1,this.d-1,this.e-1,this.f)
this.f++; this.menus[this.a-1][this.b-1][this.c-1][this.d-1]
[this.e-1].subs=this.f
}
if(end) str+="</div>"
document.write(str)
}

</script>
</HEAD>
<BODY bgcolor="White">
<script type="text/javascript" language="JavaScript">
/
************************************************** ******************************
Calling the write functions and setting variables
************************************************** ******************************/
//Variables to set

oFoldMenu=new foldoutMenuObj(''oFoldMenu'')
oFoldMenu.substay=false //Should the sub menus stay folded?
oFoldMenu.sub2stay=false //Should the sub2 menus stay folded?
oFoldMenu.sub3stay=false //Should the sub3 menus stay folded?
oFoldMenu.sub4stay=false //Should the sub4 menus stay folded?
oFoldMenu.sub5stay=false //Should the sub5 menus stay folded?
oFoldMenu.sub6stay=false //Should the sub6 menus stay folded?

oFoldMenu.menubetween=5 //The pixel value between the foldoutmenus
oFoldMenu.left=80 //The left position of the menu
oFoldMenu.top=100 //The top position of the menu
oFoldMenu.width=420 //The width of the menu
oFoldMenu.maxheight=2000 //The maxheight of the menu, be sure to set
this one high enough

//Setting styles
oFoldMenu.clFold="" //Regular styles for the topDivs
oFoldMenu.clSub="left:10" //Styles for the subDivs
oFoldMenu.clSub2="left:20" //Styles for the sub2Divs
oFoldMenu.clSub3="left:30" //Styles for the sub3Divs
oFoldMenu.clSub4="left:40" //Styles for the sub4Divs
oFoldMenu.clSub5="left:60" //Styles for the sub5Divs

oFoldMenu.clCont="position:absolute;" //The cont layer, set position
to relative if you want to try and have it inside a layer or whatever
oFoldMenu.clFoldLinks="font-family:Arial, Helvetica; font-size:11px;
text-decoration:none; font-weight:normal; color:#663300" //The style
for the toplinks
oFoldMenu.clSubLinks="font-family:Arial, Helvetica; font-size:11px;
font-weight:normal; text-decoration:none; color:#999900" //The style
for the sublinks
oFoldMenu.clSub2Links="font-family:Arial, Helvetica; font-size:11px;
text-decoration:none; color:#CC6699" //The style for the sub2links
oFoldMenu.clSub3Links="font-family:Arial, Helvetica; font-size:11px;
text-decoration:none; color:#66CC33" //The style for the sub3links
oFoldMenu.clSub4Links="font-family:Arial, Helvetica; font-size:11px;
text-decoration:none; color:#66CC33" //The style for the sub4links
oFoldMenu.clSub5Links="font-family:Arial, Helvetica; font-size:10px;
text-decoration:none; color:#66CC33" //The style for the sub5links

//Do not change this line!
oFoldMenu.makeStyle()
//Making menus

/*ARGUMENTS:
type = what type of menu this item is (top,sub,sub2,sub3,sub4,sub5)
text = the text for the item
lnk = the link for the item (not needed if submenus)
target = the target for the link (not needed if no target or no link)
offimage = the default "arrow" image for this element (if you spesify
no text, you can use the image only)
onimage = the image to swap to when clicked (not needed if you don''t
want a swap image)
fc = if you want the item to execute another javascript function
aswell use this
opn = if you want this particilar item to be opened on load set this
to 1 (0,1)
*/

//MAIN 1
oFoldMenu.make(''top'',''FURNITURE'',0,0,''images/arrow.gif'',''images/
arrow1.gif'')
oFoldMenu.make(''sub'',''not working'',0,0,''images/arrow.gif'',''images/
arrow1.gif'')
oFoldMenu.make(''sub2'',''here is the text that is overlapping the menu
below it when using firefox. If i use internet explorer this works
just fine. Please help, it would be much appreciated. here is the text
that is overlapping the menu below it when using firefox. If i use
internet explorer this works just fine. Please help, it would be much
appreciated.here is the text that is overlapping the menu below it
when using firefox. If i use internet explorer this works just fine.
Please help, it would be much appreciated. here is the text that is
overlapping the menu below it when using firefox. If i use internet
explorer this works just fine. Please help, it would be much
appreciated. '')
oFoldMenu.make(''sub2'',''another'',''http://www.3pc.com/
index.html'','''',''images/arrow.gif'',''images/arrow1.gif'')
oFoldMenu.make(''sub2'',''yet another'',''http://www.abundanttech.com/
index.html'','''',''images/arrow.gif'',''images/arrow1.gif'')

//MAIN 2
oFoldMenu.make(''top'',''OBJECT'',0,0,''images/arrow.gif'',''images/
arrow1.gif'')
oFoldMenu.make(''sub'',''Arts & Humanities'',0,0,''images/
arrow.gif'',''images/arrow1.gif'')
oFoldMenu.make(''sub2'',''Art History'',0,0,''images/arrow.gif'',''images/
arrow1.gif'')
oFoldMenu.make(''sub3'',''Architectural History'',0,0,''images/
arrow.gif'',''images/arrow1.gif'')
oFoldMenu.make(''sub4'',''Architects'',0,0,''images/arrow.gif'',''images/
arrow1.gif'')
oFoldMenu.make(''sub2'',''Arts Therapy'',''http://www.3pc.com'',''_blank'')
oFoldMenu.make(''sub2'',''Awards'',''http://www.3pc.com'',''_blank'')
oFoldMenu.make(''sub2'',''Booksellers'',''http://www.3pc.com'',''_blank'')
oFoldMenu.make(''sub2'',''Censorship'',''http://www.3pc.com'',''_blank'')
oFoldMenu.make(''sub2'',''Chats and Forums'',0,0,0,0,0,0,1)
function start(){
oFoldMenu.construct()
}

onload=start;

</script>

not working properly - click on furniture and not working to see the
text that overlaps the buttons.
</BODY>
</HTML>


On Feb 9, 5:33 am, "tim" <timden...@gmail.comwrote:
\t
On Feb 9, 5:33 am, "tim" <timden...@gmail.comwrote:
\t
\t\t\t\tHeres the code, if you try it in firefox and ie you’’ll see what i

mean.
Heres the code, if you try it in firefox and ie you''ll see what i
mean.



Can I say that this is really dreadful old code? Please look at

ditching it as soon as possible, it really is awful. Checkout lists

at alistapart:


<URL: http://www.alistapart.com/articles/horizdropdowns/ >


Expanding tree menus should be coded as lists and the script should

use feature detection so that if scripting isn’’t supported or is

disabled, users will still get a functional hierarchical menu.


Anyhow, likely you want a quick fix so I’’ve suggested something

below. The problem is in the fold_style function.

[...]
\t

Can I say that this is really dreadful old code? Please look at
ditching it as soon as possible, it really is awful. Checkout lists
at alistapart:

<URL: http://www.alistapart.com/articles/horizdropdowns/ >

Expanding tree menus should be coded as lists and the script should
use feature detection so that if scripting isn''t supported or is
disabled, users will still get a functional hierarchical menu.

Anyhow, likely you want a quick fix so I''ve suggested something
below. The problem is in the fold_style function.
[...]

\t
\t\t\t\tfunction fold_style(){

str=’’\n<style type="text/css">\n’’

str+=’’\tDIV.cl’’+this.name+’’{position:absolute; ’’+ this.clFold +’’;

width:’’+this.width+’’; height:20}\n’’

str+=’’\tDIV.cl’’+this.name+’’Sub{position:absolute; ’’+ this.clSub

+’’;height:20; width:’’+this.width+’’; visibility:hidden}\n’’

str+=’’\tDIV.cl’’+this.name+’’Sub2{position:absolute; ’’+ this.clSub2

+’’;height:20; width:’’+this.width+’’; visibility:hidden}\n’’
function fold_style(){
str=''\n<style type="text/css">\n''
str+=''\tDIV.cl''+this.name+''{position:absolute; ''+ this.clFold +'';
width:''+this.width+''; height:20}\n''
str+=''\tDIV.cl''+this.name+''Sub{position:absolute; ''+ this.clSub
+'';height:20; width:''+this.width+''; visibility:hidden}\n''
str+=''\tDIV.cl''+this.name+''Sub2{position:absolute; ''+ this.clSub2
+'';height:20; width:''+this.width+''; visibility:hidden}\n''



The problem is here, where the height of the menu elements are hard-

coded. If you replace the above line with:


str+=’’\tDIV.cl’’+this.name+’’Sub2{position:absolute; ’’ + this.clSub2

+ ’’; visibility:hidden}\n’’

it will "work". I’’d suggest modifying all similar lines, there is no

reason to hard-code the height. Note that I haven’’t bothered to look

too deeply into the code because I think it would be much faster to

just re-write it.


--

Rob

The problem is here, where the height of the menu elements are hard-
coded. If you replace the above line with:

str+=''\tDIV.cl''+this.name+''Sub2{position:absolute; '' + this.clSub2
+ ''; visibility:hidden}\n''
it will "work". I''d suggest modifying all similar lines, there is no
reason to hard-code the height. Note that I haven''t bothered to look
too deeply into the code because I think it would be much faster to
just re-write it.

--
Rob


这篇关于Firefox无法识别文本之间的javascript空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆