Sending a click event to the bottom layer

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MickeyMonkey
    New Member
    • Sep 2007
    • 4

    Sending a click event to the bottom layer

    I have two layer one is on top, and bottom.
    I want to click the bottom layer.
    Does we can do that in javascript?

    mickey
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya Mickey. Welcome to TSDN!

    Changed thread title to better describe the problem (did you know that threads whose titles do not follow the Posting Guidelines actually get FEWER responses?).

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Can you show some code?

      Comment

      • MickeyMonkey
        New Member
        • Sep 2007
        • 4

        #4
        Originally posted by pbmods
        Heya Mickey. Welcome to TSDN!

        Changed thread title to better describe the problem (did you know that threads whose titles do not follow the Posting Guidelines actually get FEWER responses?).

        Thanks, pbmods!

        Mickey

        Comment

        • MickeyMonkey
          New Member
          • Sep 2007
          • 4

          #5
          Originally posted by acoder
          Can you show some code?
          the following are my codes:

          [HTML]<div id='dtop' style='position :absolute;top:0 px;' onclick="javasc ript:alert('hel lo');">
          <img src='top.jpg' id='imgtop' name='imgtop'/>
          </div>

          <div id='dbottom' style='position :absolute;top:0 px;' onclick="javasc ript:alert('hel lo bottom');">

          <img src='bottom.jpg ' id='imgbottom' name='imgbottom '/>

          </div>
          [/HTML]
          I can not click on second <div>.
          If I want to click on second <div>, what should I do?

          Mickey,
          Last edited by acoder; Sep 20 '07, 10:34 AM. Reason: Added code tags

          Comment

          • dmjpro
            Top Contributor
            • Jan 2007
            • 2476

            #6
            Originally posted by MickeyMonkey
            the following are my codes:

            [code=html]
            <div id='dtop' style='position :absolute;top:0 px;' onclick="javasc ript:alert('hel lo');">
            <img src='top.jpg' id='imgtop' name='imgtop'/>
            </div>

            <div id='dbottom' style='position :absolute;top:0 px;' onclick="javasc ript:alert('hel lo bottom');">

            <img src='bottom.jpg ' id='imgbottom' name='imgbottom '/>

            </div>
            [/code]

            I can not click on second <div>.
            If I want to click on second <div>, what should I do?

            Mickey,
            Ok!
            Try this.

            [code=javascript]
            document.getEle mentById('dbott om').click();
            [/code]

            Kind regards,
            Dmjpro.

            Comment

            • acoder
              Recognized Expert MVP
              • Nov 2006
              • 16032

              #7
              Use code tags when posting code, e.g.
              &#91;CODE=ht ml]
              HTML code goes here
              [/CODE]

              &#91;CODE=javas cript]
              JavaScript code goes here
              [/CODE]

              Comment

              • MickeyMonkey
                New Member
                • Sep 2007
                • 4

                #8
                Originally posted by dmjpro
                Ok!
                Try this.

                [code=javascript]
                document.getEle mentById('dbott om').click();
                [/code]

                Kind regards,
                Dmjpro.
                My problem is when I try to create a Roulette by using javascript.
                Roulette, there are alot of numbers on table, and it allows player to bet on line as well that is the problem.

                So when I place a chip on a number nearby a betting line then I can never click on that line anymore because the chip is over the betting line.
                (chip and line I use DIV to show the image).

                Is it possible in javascript that I still click on that line(div) although chip( another div) is over it?


                Regards,
                Mickey

                Comment

                • pbmods
                  Recognized Expert Expert
                  • Apr 2007
                  • 5821

                  #9
                  Heya, Mickey.

                  Presumably, you want the User to be able to remove chips as well, perhaps by clicking on the chips themselves.

                  My recommendation would be to redesign either your 'table' or your chip graphic so that both are visible.

                  Alternatively, you could create a pop-up that appears when the User clicks on the chips that gives the User the option of removing or increasing his bet.

                  Comment

                  Working...