/    Sign up×
Community /Pin to ProfileBookmark

mozilla 1.4 issue – works fine in other browsers..

  • I have a script that works perfectly in firefox and explorer but is not working in mozilla 1.4 which is the default browser of the users.
  • It toggles a div on and off from a graphic button to create the effect of a pop up window.
    I have this in the head:

    css:
    #popupBox {
    position: absolute;
    top: 26px;
    left: 126px;
    border: solid 1px #000000;
    visibility:hidden;
    height: 307px;
    background-image: url(content_images/smlpo.jpg);
    width: 231px;
    }

    javascript:

    <script language=”JavaScript” type=”text/JavaScript”>
    <!–
    function show_popup(){
    document.all.popupBox.style.visibility = “visible”;
    }

    function hide_popup(){
    document.all.popupBox.style.visibility = “hidden”;
    }

    function toggle_popup(){
    if (document.all.popupBox.style.visibility == “visible”)
    hide_popup();
    else show_popup();
    }
    //–>
    </script>

    and in the body:

    <a href=”javascript://” onClick=”toggle_popup()””>

    mozilla’s debugger is telling me there’s an issue with ‘document.all.’ but I can’t figure out what’s tripping it up.

    Any clues gratefully appreciated!

    thx

    to post a comment
    JavaScript

    2 Comments(s)

    Copy linkTweet thisAlerts:
    @A1ien51Jul 13.2005 — you should be using

    document.getElementById("theId").style...

    Eric
    Copy linkTweet thisAlerts:
    @olbertoauthorJul 13.2005 — you should be using

    document.getElementById("theId").style...

    Eric[/QUOTE]


    Thanks for this Eric, I've tried to use that but then I hang up on the definition of the element- debugger tells me:

    Error: missing ; before statement

    Line: 45, Column: 67

    Source Code:

    document.getElementById("popupBox").style.visibility == "visible")

    and that

    Error: toggle_popup is not defined

    Can't seem to get my head around it...

    This is a great site, I'm gonig to try and brush up on my javascript a bit - this really helps...

    thx
    ×

    Success!

    Help @olberto spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.29,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...