Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help Plz -->JavaScrpit XpertZ

    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

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    FL, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi there rasiris,

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

    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
    CYWebmaster.com - See why we dot com!!
    ACJavascripts.com - Cut & Paste Javascripts!
    SimplyProgram.com - Personal Blog

  • #3
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thxs

    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 !

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    FL, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    CYWebmaster.com - See why we dot com!!
    ACJavascripts.com - Cut & Paste Javascripts!
    SimplyProgram.com - Personal Blog


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •