...

View Full Version : Help Plz -->JavaScrpit XpertZ



rasiris
06-23-2002, 06:13 AM
Hi everyone ! I want to ask a question to see if anybody knows the answer to this puzzle ( related to a cascade menus script)

the commands:

menu.style.pixelTop = obj.getBoundingClientRect().top + obj.offsetHeight + Bdy.scrollTop
menu.style.pixelLeft = obj.getBoundingClientRect().left + Bdy.scrollLeft

Don't work on an Earthlink browser. In 1 computer I was playing around and I found that the following commands:

menu.style.pixelTop = obj.getBoundingClientRect().top + obj.offsetHeight + Bdy.scrollTop +50
menu.style.pixelLeft = obj.getBoundingClientRect().left + Bdy.scrollLeft +605

do work, but they don't in the explorer.

So, is there a way to combine a script into working in both browsers ???

Thanks for all your time guys

ACJavascript
06-24-2002, 04:43 PM
Hi there rasiris,

Well this should work for ya. *crossing fingers* hehe:thumbsup:

heres how the code works


-------

<script language="javascript">

var ie,earth

if(navigator.appName=="Microsoft Internet Explorer"){
ie=true
}else{
earh=true
}


function Code(){

if(ie){
//Explorer
menu.style.pixelTop = obj.getBoundingClientRect().top + obj.offsetHeight + Bdy.scrollTop
menu.style.pixelLeft = obj.getBoundingClientRect().left + Bdy.scrollLeft
}else{
//Other Browser, Or Earthlink
menu.style.pixelTop = obj.getBoundingClientRect().top + obj.offsetHeight + Bdy.scrollTop +50
menu.style.pixelLeft = obj.getBoundingClientRect().left + Bdy.scrollLeft +605
}
}

</script>

--------

the var ie,earth

represent Internet explorer and Earthlink

the if construction sees if the user is using IE or Earthlink(or other browsers)

if its IE then ie=true
if its earthlink then earth=true

So when you set up your function to perform the task

you set it up like this

if(ie){
alert("YOUR IE BROWSER")
}else{
alert("YOUR USING ANOTHER BROWSER")
}



Hope this helps :):):)

rasiris
06-25-2002, 01:05 AM
Thxs for your help. BTW You don't happen to know why that command is not recognizable by an earthlink browser ? ( don't you love the compability standard of the Web ? jejeje ) or perhaps u know a similiar command usable in an earthlink browser ?

Thxs VERY much 4 ya help anyways !

ACJavascript
06-25-2002, 02:44 AM
I have never even heard of an earthlink borwser. So could you give a link to there browsers site. So i can customize the script to it:)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum