Sha256: 76da493c9d120860e263a7c35bc524a7e66a0405e7f04de8edd797516b5b7bdf

Contents?: true

Size: 1.06 KB

Versions: 10

Compression:

Stored size: 1.06 KB

Contents

<!doctype HTML>
<html>
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title>Mouse fixture</title>
</head>
<body>

  <h1>Mouse test</h1>
  <div id="test" style="">
    Test area
  </div>
  <pre id="log"></pre>

<style type="text/css">
#test {
  width: 100px;
  height: 100px;
  background: #CCC;
}

#test:hover {
  background: #FAA;
}
</style>

<script type="text/javascript">
logEl = document.getElementById("log");

function handler(e) {
  e.preventDefault();

  var modifiers = []
  if (e.altKey)  modifiers.push('alt');
  if (e.ctrlKey) modifiers.push('ctrl');
  if (e.metaKey) modifiers.push('meta');
  if (e.shiftKey) modifiers.push('shift');

  logEl.innerHTML = logEl.innerHTML + [
    e.type,
    e.button,
    modifiers
  ].join(" ") +
  "\n";

  console.log(e);

  return false;
}

document.getElementById("test");
test.addEventListener('mousedown', handler, false);
test.addEventListener('mouseup', handler, false);
test.addEventListener('click', handler, false);
test.addEventListener('dblclick', handler, false);
</script>

</body>
</html>

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
operawatir-0.7.pre4-jruby spec/operawatir/fixtures/mouse.html
operawatir-0.7.pre3-jruby spec/operawatir/fixtures/mouse.html
operawatir-0.7.pre2-jruby spec/operawatir/fixtures/mouse.html
operawatir-0.7.pre1-jruby spec/operawatir/fixtures/mouse.html
operawatir-0.6.pre1-jruby spec/operawatir/fixtures/mouse.html
operawatir-0.5.1-jruby spec/operawatir/fixtures/mouse.html
operawatir-0.5-jruby spec/operawatir/fixtures/mouse.html
operawatir-0.5.pre3-jruby spec/operawatir/fixtures/mouse.html
operawatir-0.5.pre2-jruby spec/operawatir/fixtures/mouse.html
operawatir-0.5.pre1-jruby spec/operawatir/fixtures/mouse.html