<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html>

    <head>
        <title></title>
        <style>
        body {
            margin:  0;
            padding: 0;
        }
        </style>

        <script type="text/javascript" src="js/mootools.js"></script>
        <script>

        function clicked(e){
            if(e.button == 2){
                console.debug('right clicked');
            } else {
                console.debug('left clicked');
            }

        }


    window.addEvent('domready',function(){

        var d = new Element('div',{
            'styles' : { 'border' : '1px solid #999', 'height' : 300,
'width' : 400}
        }).injectInside(document.body);

        // change d to document to show right click detection
        d.addEventListener('click', clicked,false);

    });

    </script>
    </head>
    <body>

    </body>
</html>

Reply via email to