Jquery stop method

Advertisements

Prev Tutorial Next Tutorial

stop() method

JQuery stop() method is used to stop animations or effects before it is finished.

Syntax

$(selector).stop(stopAll,goToEnd);

Example of stop method

<!DOCTYPE html>
<html>
<head>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

<style>
#flip {
    padding: 5px;
    font-size: 14px;
    text-align: center;
    background-color: #3399FF;
    color: white;
    border: solid 1px #666;
    border-radius: 3px;
}

#panel {
    font-size: 18px;
    text-align: center;
    background-color: #3399FF;
    color: white;
    border: solid 1px #666;
    border-radius: 3px;
    padding: 50px;
    display: none;
}
</style>

<script>
$(document).ready(function(){
    $("#flip").click(function(){
        $("#panel").slideDown(10000);
    });
    $("#stop").click(function(){
        $("#panel").stop();
    });
});
</script>

</head>
<body>

<button id="stop">Stop sliding</button>

<div id="flip">Click Here to slide down panel</div>
<div id="panel">Hello world!</div>

</body>
</html>

Output

Click Here to slide down panel
Hello world!

Prev Tutorial Next Tutorial

Google Advertisment

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 9999595223

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

For Projects 9999595223

Google Advertisements


Buy Websites 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements