Cross browser event issues

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • MartinRinehart@gmail.com

    Cross browser event issues

    In my next post I'll submit an Opera-only, canvas-based widget. My
    intent is to write code that runs in Chrome, Firefox, Opera and
    Safari. Below is a tiny tester for the events I want to handle. Any
    help getting this to support the <canvascommunit y would be
    appreciated.
    --------------------------------------
    <! t.html - test event handling>

    <html>
    <head>
    <script>
    function click_() { alert( 'click' ); }
    function keyPress() { alert( 'keyPress' ); }
    function wheel() { alert( 'wheel' ); }
    </script>
    <style>
    table {
    position:absolu te; top:10px; left:10px;
    background: red;
    }
    .label {
    position:absolu te; top:80px; left:10px;
    }
    canvas {
    position:absolu te; top:100px; left:10px;
    background:blue ;
    }
    </style>
    </head>
    <body>
    <button style='font-size:18px; background:yell ow'
    onclick=click_( ) onkeypress=keyP ress() onmousewheel=wh eel()>
    button
    </button>
    <div class=label>Can vas:</div>
    <canvas height=50 width=100
    onclick=click() onkeypress=keyP ress() onmousewheel=wh eel()>
    no canvas
    </canvas>
    </body>
    </html>

    <! end of t.html>
  • MartinRinehart@gmail.com

    #2
    Re: Cross browser event issues

    Bug in code. Name of click handler in canvas should be "click_", not
    just "click".

    Comment

    • Martin Rinehart

      #3
      Re: Cross browser event issues

      WARRNING! PPK's dropdown widget Krashed Konqueror. Scroll or search
      instead.

      Seems we're still on the bleeding edge, here:



      Worse, above table is one dimension short. What works depends on what
      it's attached to. Firefox fires keydown on a button, but not on a
      canvas.

      Worst, the w3c documentation makes the implicit assumption that the
      JavaScript widget set is sufficiently complete that no one would be
      adding their own.

      Comment

      • dhtml

        #4
        Re: Cross browser event issues

        MartinRinehart@ gmail.com wrote:
        In my next post I'll submit an Opera-only, canvas-based widget. My
        intent is to write code that runs in Chrome, Firefox, Opera and
        Safari. Below is a tiny tester for the events I want to handle. Any
        help getting this to support the <canvascommunit y would be
        appreciated.
        --------------------------------------
        <! t.html - test event handling>
        >
        Posts with valid HTML tend to get much better responses here.


        You can't really expect anything from such invalid code.

        Garrett

        --
        comp.lang.javas cript FAQ <URL: http://jibbering.com/faq/ >

        Comment

        • dhtml

          #5
          Re: Cross browser event issues

          MartinRinehart@ gmail.com wrote:
          In my next post I'll submit an Opera-only, canvas-based widget. My
          intent is to write code that runs in Chrome, Firefox, Opera and
          Safari. Below is a tiny tester for the events I want to handle. Any
          help getting this to support the <canvascommunit y would be
          appreciated.
          --------------------------------------
          <! t.html - test event handling>
          >
          Posts with valid HTML tend to get much better responses here.


          You can't really expect invalid code like that to do what you want it to.

          Garrett

          --
          comp.lang.javas cript FAQ <URL: http://jibbering.com/faq/ >

          Comment

          Working...