0

Possible Duplicate:
Disable doubleclick event for an element in Opera

I've got problem with Opera browser. It's only one that does show up context menu on double left click/selection. I have page with div's which are empty (background images). They have hooked click and contextmenu events and click is working fine when you click slow. If you click twice faster text get's selected. What I observed is that probably main reason for this is using inline-block, just because of treating whole as one line. Here is example code:

<!doctype html>
<html>
    <head>
        <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.8/dojo/dojo.js" data-dojo-config="async: 1"></script>
    </head>
    <body>
        <div style="display: inline-block;">
        <table>
            <tr>
                <th colspan="3">Header</th>
            </tr>
            <tr>
                <td></td>
                <td>
                <div id="test" style="height: 38px; width: 38px; background: red;">
                </div>
            </td>
            <td></td>
        </tr>
      </table>
    </div>
    <div style="display: inline-block;">
      <table>
            <tr>
                <th colspan="3">Header</th>
            </tr>
            <tr>
                <td></td>
                <td>
                <div id="test" style="height: 38px; width: 38px; background: red;">
                </div>
            </td>
            <td></td>
        </tr>
      </table>
    </div>
    </body>
</html>
<script type="text/javascript">
require(["dojo/dom", "dojo/on","dojo/domReady!"], function(dom, on) {
    on(dom.byId('test'), 'click', function() { /* do something here */ return false; });
});
</script>

Is it possible to prevent it, leaving inline-block? I'm especially interested in solution with Dojo, if possible.

Community
  • 1
  • 1
mariozski
  • 1,134
  • 1
  • 7
  • 20
  • I've switched div's to float: left for now, but if anyone would have any way to prevent it I'll be happy to accept it :-) – mariozski Oct 15 '12 at 12:30

1 Answers1

0

I suspect this has little to do with your code and everything with Opera's default settings.

Here is an article on how to disable contextmenu on double-click. Obviously this does not solve your problem since it is a setting on the client side you have no control over.

Laoujin
  • 9,962
  • 7
  • 42
  • 69