jQuery finish() Method Last Updated : 30 Jun, 2023 Comments Improve Suggest changes Like Article Like Report The finish() is an inbuilt method in jQuery which is used to stop the animations running at the present time. Syntax: $(selector).finish(); Parameter: It does not accept any parameter. Return Value: It returns the selected element with its final values. jQuery code to show the working of finish() method: html <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"> </script> <script> <!-- jQuery code to show the working of this method --> $(document).ready(function() { $("#b1").click(function() { $("div").animate({ height: 200 }, 4000); $("div").animate({ width: 200 }, 4000); }); $("#b2").click(function() { $("div").finish(); }); }); </script> <style> div { background: green; height: 100px; width: 100px; padding: 30px; } </style> </head> <body> <div></div> <p> <!-- this button will start the animation --> <button id="b1">Start </button> <!-- this button will finish the animation --> <button id="b2">Stop</button> </p> </body> </html> Output: Before clicking on the "Start" button- After clicking on the start button animation will start with its specified speed and when stop button is clicked then it immediately finish the animation and return the element to its final height and width value. Comment More infoAdvertise with us Next Article jQuery hide() Method K kundankumarjha Follow Improve Article Tags : JavaScript Web Technologies JQuery jQuery-Effects Similar Reads jQuery animate() Method The animate() method is an inbuilt method in jQuery which is used to change the state of the element with CSS style. This method can also be used to change the CSS property to create the animated effect for the selected element. Syntax: (selector).animate({styles}, para1, para2, para3); Here "select 2 min read jQuery clearQueue() Method The jQuery clearQueue() method removes all items from the queue that have not yet been run. Note that when a function has started to run, it runs until it is completed. Syntax: $(selector).clearQueue(name); Here "selector" is the selected element. Parameter: It accepts a parameter "name" which is th 2 min read jQuery delay() Method jQuery delay() method is an inbuilt that is used to set a timer to delay the execution of the next item in the queue. Syntax:$(selector).delay(para1, para2);Parameter: It accepts two parameters which are specified below: para1: It specifies the speed of the delay.para2: It is optional and specifies 2 min read jQuery dequeue() Method The dequeue() method is an inbuilt method in jQuery that is used to remove the next function from the queue and then it will execute the function. In a queue there will be several functions waiting to run dequeue() used to remove the top function from the queue and execute that function. Syntax: $(s 2 min read jQuery fadeIn() Method The fadeIn() method in jQuery is used to change the opacity of selected elements from hidden to visible. The hidden elements will not be display. Syntax: $(selector).fadeIn( speed, easing, callback ) Parameters: This method accepts three parameters as mentioned above and described below: Speed: It i 2 min read jQuery Effect fadeOut() Method The fadeOut()Method in jQuery is used to change the level of opacity for selected element from visible to hidden. By using this method, the faded element will not occupy any space. Syntax: $(selector).fadeOut( speed, easing, callback ) Parameters: This method accepts three parameters as mentioned ab 2 min read jQuery fadeTo() Method The fadeTo() method is an inbuilt method in jQuery that is used to change the opacity of the selected element. Syntax: $(selector).fadeTo(speed, opacity, easing, call_function) Here selector is the selected element. Parameter: It accepts four parameters which are specified below- speed: It specifies 2 min read jQuery fadeToggle() Method The fadeToggle() Method in jQuery toggles between the fadeIn() and fadeOut() methods. If elements are faded in, fadeToggle() will fade out. If elements are faded out, fadeToggle() will fade in. Syntax:$(selector).fadeToggle(speed, easing, callback)Parameters: This method accepts three parameters as 2 min read jQuery finish() Method The finish() is an inbuilt method in jQuery which is used to stop the animations running at the present time. Syntax: $(selector).finish(); Parameter: It does not accept any parameter. Return Value: It returns the selected element with its final values. jQuery code to show the working of finish() me 1 min read jQuery hide() Method The jQuery hide() method is used to hide selected HTML elements with a smooth animation effect. It reduces the elementâs height to zero, effectively making it invisible. The method can also take a duration parameter to control the speed of the hiding animation.Syntax:$(element_selector).hide(duratio 3 min read Like