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 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    Iran
    Posts
    695
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Simple menu problem

    Hi, I'm trying to make a text that when the mouse goes over that, some other texts ( seperate lines ) go beneath the main line, like a kinda simple menu. Then user can click on the second texts ( texts that appeared after the mouse went on the first text ) and by clicking on each of them, for example we have an alert. The problem is that I'm using 2 nested spans, but when the mouse leaves the first or the children span's items, the children items do not disappear. I put the code below, I hope someone can help:

    //---------------------------------------------
    <html>
    <head>
    <title>Untitled</title>
    <script>
    function doit(what)
    {
    if ( what == "open" )
    document.getElementById("Sec").innerHTML =
    "<span style='color : \"red\";' onclick='alert(\"hello\");'>yes</span>";
    else
    document.getElementById("Sec").innerHTML =
    "&nbsp;";
    }
    </script>
    </head>

    <body>


    <span style="position : relative; cursor : 'hand'; width : 100px" onmouseover="doit('open');" >
    First Item
    <span id="Sec" onmouseout="doit('close');">
    &nbsp;
    </span>
    </span>


    </body>
    </html>

  • #2
    Regular Coder
    Join Date
    Jul 2002
    Location
    Iran
    Posts
    695
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello? it's about some days that I posted this! you mean nobody knows the answer?

  • #3
    Regular Coder
    Join Date
    Aug 2002
    Location
    Oregon, United States of America
    Posts
    882
    Thanks
    1
    Thanked 9 Times in 9 Posts

    lol

    How about you just use a menu instead of trying to do a *cough* lame *cough* menu using spans.

    The only way I know of to do this is using images. So when you click on the top image it changes some images below from transparent ones to ones with the words that you want showing.

    Why dont you try one like, (or the actual one) found on this page. (Thereis no copyright)

    xng clan
    If I'm postin here, I NEED YOUR HELP!!

  • #4
    Regular Coder
    Join Date
    Jul 2002
    Location
    Iran
    Posts
    695
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanx! at least one reply! Actually they didn't pay me enough and I don't wana put a menu for them! you know what I mean! I just wanted to have a simple thing, but in my case, all the simple things do not work!

  • #5
    Regular Coder
    Join Date
    Aug 2002
    Location
    Oregon, United States of America
    Posts
    882
    Thanks
    1
    Thanked 9 Times in 9 Posts

    yeah

    no kidding. I am have seen millions of up-down manual scroller. But I wanna change up-down to left-right, and I've been working for days. LOL. (Thx Beetle)
    If I'm postin here, I NEED YOUR HELP!!


  •  

    Posting Permissions

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