/    Sign up×
Community /Pin to ProfileBookmark

Pop-Up Menu (almost) Working

ok everything works on this so far except for two things:

  • how to make it work when a [B]spacific key[/B] is pressed

  • and how to make it so [B]it comes up in the right spot when I scroll[/B] on the page
    (and doesn’t pop-up off the screen where I can’t see it)
  • [CODE]

    <script language=”Javascript”>
    <!–
    function toggleDiv(id,flagit) {
    if (flagit==”1″)
    {
    if (document.layers) document.layers[”+id+”].visibility = “show”
    else if (document.all) document.all[”+id+”].style.visibility = “visible”
    else if (document.getElementById) document.getElementById(”+id+”).style.visibility = “visible”
    }
    if (flagit==”0″)
    {
    if (document.layers) document.layers[”+id+”].visibility = “hide”
    else if (document.all) document.all[”+id+”].style.visibility = “hidden”
    else if (document.getElementById) document.getElementById(”+id+”).style.visibility = “hidden”
    }
    }

    function ViewData(user,ValueShow)
    {
    if(user.style.visibility==ValueShow)return true

    var mousex = window.event.x; // mouse location capture event
    var mousey = window.event.y; // mouse location capture event
    user.style.visibility = ValueShow; // show or hide respective Example
    user.style.left = mousex – 50; // place popup at the mouse X (left) location
    user.style.top = mousey; // place popup at the mouse Y (top) location

    }
    //–>
    </script>

    <style>
    #example1 {
    position:absolute;
    width:150px;
    height:100px;
    color:blue;
    text-align:center;
    visibility:hidden;
    z-index:10;
    }
    </style>

    </head>
    <body onKeyDown=”ViewData(example1,’visible’)” onKeyUp=”ViewData(example1,’hidden’)”>

    <div id=”example1″>
    This is the menu
    </div>

    </body>[/CODE]

    to post a comment
    JavaScript

    0Be the first to comment 😎

    ×

    Success!

    Help @Jr- 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 4.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: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

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

    tipper: @Samric24,
    tipped: article
    amount: 1000 SATS,
    )...