jQuery mouseup() trigger slide event

Description

jQuery mouseup() trigger slide event

View in separate window


<!DOCTYPE html>
<html>
<head>
<script 
 src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js">
</script>/*from w  w w. ja  va  2s  . c  o m*/
<script>
$(document).ready(function(){
  $("button").mouseup(function(){
    $("p").slideToggle();
  });
  $("div").mouseover(function(){
    $("button").mouseup();
  });
});
</script>
</head>
<body>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<button>Toggle</button><br><br>

<div>Mouse over this text to trigger the mouseup event for the button above.</div>

</body>
</html>



PreviousNext

Related