Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Demostrate some potential discrepancies on how click and mouse down handlers are processed. If a mousedown and a click handlers are registered, click is sometimes not triggered when the visibility CSS attribute is manipualted in the mousedown handler on Safari and Firefox.">
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  <div id="outer">
    <div id="container" class="hidden">
      <div id="inner" class="boxes"></div>
    </div>
  </div>
  
  <div class="description">
    <p>Click in the middle of the orange area twice.</p>
    <h3>On Safari, Firefox</h3>
    <ol>
      <li>Mousedown</li>
      <li>Mousedown</li>
      <li>Click</li>
    </ol>
    
    <h3>On Chrome</h3>
    <ol>
      <li>Mousedown</li>
      <li>Click</li>
      <li>Mousedown</li>
      <li>Click</li>
    </ol>
    
    <h3>Event log:</h3>
    <ol class="events"></ol>
  </div>
  
</body>
</html>
 
$(function(){
  $('#outer').on('mousedown', function() {
    $('#container').removeClass('hidden');
    $('.events').append('<li>Mousedown</li>');
  });
  
  $('#outer').on('click', function() {
    $('.events').append('<li>Click</li>');
  });
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
martinenopro
0viewers