How to Create a start and stop Function using jQuery

How to Create a start and stop Function using jQuery

In this article, we will explain How to Create a start and stop Function using jQuery.

Example:-

<html>
<head>
<title>start() and stop() Function using jQuery</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script> 
$(document).ready(function(){
 $("#start").click(function(){
    $("#panel").slideDown(5000);
  });
  $("#stop").click(function(){
    $("#panel").stop();
  });
});
</script>
<style> 
#panel, #flip {
  padding: 5px;
  font-size: 18px;
  text-align: center;
  background-color: Red;
  color: white;
  border: solid 1px #666;
  border-radius: 3px;
}

#panel {
  padding: 50px;
  display: none;
}
</style>
</head>
<body>
<button id="start">Start sliding</button>
<button id="stop">Stop sliding</button>
<div id="flip">Welcome to Hub of Tutorials</div>
<div id="panel">Start() and Stop() Function</div>
</body>
</html>

Leave A Reply