mouse-events.html 1.78 KB
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>CasperJS test mouse events</title>
    </head>
    <body>
        <a id="test1" href="#" onmousedown="results.test1 = true;">test</a>
        <a id="test2" href="#">test</a>
        <a id="test3" href="#" onmouseup="results.test3 = true;">test</a>
        <a id="test4" href="#">test</a>
        <a id="test5" href="#" onmouseover="results.test5 = true;">test</a>
        <a id="test6" href="#">test</a>
        <a id="test7" href="#" onmouseout="results.test7 = true;">test</a>
        <a id="test8" href="#">test</a>
        <script>
            (function(window) {
                window.results = {
                    test1: false,
                    test2: false,
                    test3: false,
                    test4: false,
                    test5: false,
                    test6: false,
                    test7: false,
                    test8: false
                };
                document.querySelector('#test2').onmousedown = function(event) {
                    results.test2 = true;
                    event.preventDefault();
                };
                document.querySelector('#test4').onmouseup = function(event) {
                    results.test4 = true;
                    event.preventDefault();
                };
                document.querySelector('#test6').onmouseover = function(event) {
                    results.test6 = true;
                    event.preventDefault();
                };
                document.querySelector('#test8').onmouseout = function(event) {
                    results.test8 = true;
                    event.preventDefault();
                };
            })(window);
        </script>
    </body>
</html>