{"id":1081,"date":"2024-07-17T20:19:57","date_gmt":"2024-07-17T20:19:57","guid":{"rendered":"https:\/\/www.appfinz.com\/blogs\/?p=1081"},"modified":"2025-05-15T04:59:39","modified_gmt":"2025-05-15T04:59:39","slug":"how-to-use-jquery-animation-effects","status":"publish","type":"post","link":"https:\/\/www.appfinz.com\/blogs\/how-to-use-jquery-animation-effects\/","title":{"rendered":"How to use jQuery Animation Effects"},"content":{"rendered":"\n<p>Hello Nerds, <\/p>\n\n\n\n<p>jQuery provides several built-in <strong>jQuery animation effects<\/strong>, which make it easy for us to use. It help us develop dynamic and interactive websites. Here i am explaining about<strong> jQuery animations effects<\/strong>. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">jQuery&nbsp;<code>animate()<\/code>&nbsp;Method<\/h2>\n\n\n\n<p><strong>jQuery animate() Method <\/strong>The jQuery <code>animate()<\/code> method is used to create custom animations. The animate() method is used to change any non-numeric css property, such as <strong><code>color<\/code><\/strong>, or<code> background-color<\/code> in jquery but we cannot use the basic jQuery functionality of animating properties like .getWidth(), because there are no numeric raw values to revert from.<\/p>\n\n\n\n<p>Here&#8217;s a simple example of the jQuery&nbsp;<code>animate()<\/code>&nbsp;method that animates an image from its original position to the right by 300 pixels on click of the button.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text\/x-php&quot;,&quot;theme&quot;:&quot;midnight&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;Javascript&quot;,&quot;language&quot;:&quot;PHP&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;php&quot;}\">&lt;script&gt;\n$(document).ready(function(){\n    $(&quot;button&quot;).click(function(){\n        $(&quot;img&quot;).animate({\n            left: 300\n        });\n    });\n});\n&lt;\/script&gt;<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Animate Multiple Properties At Once<\/h3>\n\n\n\n<p>Also, you can animate multiple properties of an element together using the animate() method. All properties played their animations together without delay.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text\/x-php&quot;,&quot;theme&quot;:&quot;midnight&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;Javascript&quot;,&quot;language&quot;:&quot;PHP&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;php&quot;}\">&lt;script&gt;\n$(document).ready(function(){\n    $(&quot;button&quot;).click(function(){\n        $(&quot;.box&quot;).animate({\n            width: &quot;300px&quot;,\n            height: &quot;300px&quot;,\n            marginLeft: &quot;150px&quot;,\n            borderWidth: &quot;10px&quot;,\n            opacity: 0.5\n        });\n    });\n});\n&lt;\/script&gt;<\/pre><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>Please note: With the animate() method you need to pass in camel-cased CSS property names (e.g. if you want to fade a font-size, write 'fontSize' instead of 'font-size'). eg for 'margin-left' write as 'marginLeft', for `border-width` writas be borderWidth and so on.<\/code><\/pre>\n\n\n\n<p>By using these<strong> jQuery Animation Effects <\/strong>example, you can make your websites attractive and intractive.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. hide()<\/h3>\n\n\n\n<p>The <code>hide()<\/code> method hides the selected elements with an optional animation.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text\/x-php&quot;,&quot;theme&quot;:&quot;midnight&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;Javascript&quot;,&quot;language&quot;:&quot;PHP&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;php&quot;}\">$(&quot;#element&quot;).hide(1000); \/\/ Hides the element after 1 second<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">2. show()<\/h3>\n\n\n\n<p>The <code>show()<\/code> method displays the selected elements with an optional animation.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text\/x-php&quot;,&quot;theme&quot;:&quot;midnight&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;Javascript&quot;,&quot;language&quot;:&quot;PHP&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;php&quot;}\">$(&quot;#element&quot;).show(1000); \/\/ Shows the element after 1 second<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">3. toggle()<\/h3>\n\n\n\n<p>The <code>toggle()<\/code> method toggles the visibility of the selected elements.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text\/x-php&quot;,&quot;theme&quot;:&quot;midnight&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;Javascript&quot;,&quot;language&quot;:&quot;PHP&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;php&quot;}\">$(&quot;#element&quot;).toggle(1000); \/\/ Toggles the visibility after 1 second<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">4. fadeIn()<\/h3>\n\n\n\n<p>The <code>fadeIn()<\/code> method fades in the selected elements by increasing their opacity.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text\/x-php&quot;,&quot;theme&quot;:&quot;midnight&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;Javascript&quot;,&quot;language&quot;:&quot;PHP&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;php&quot;}\">$(&quot;#element&quot;).fadeIn(1000); \/\/ Fades in the element after 1 second<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">5. fadeOut()<\/h3>\n\n\n\n<p>The <code>fadeOut()<\/code> method fades out the selected elements by decreasing their opacity.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text\/x-php&quot;,&quot;theme&quot;:&quot;midnight&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;Javascript&quot;,&quot;language&quot;:&quot;PHP&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;php&quot;}\">$(&quot;#element&quot;).fadeOut(1000); \/\/ Fades out the element after 1 second\n<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">6.fadeToggle()<\/h3>\n\n\n\n<p>The <code>fadeToggle()<\/code> method toggles the fading in and out of the selected elements.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text\/x-php&quot;,&quot;theme&quot;:&quot;midnight&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;Javascript&quot;,&quot;language&quot;:&quot;PHP&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;php&quot;}\">$(&quot;#element&quot;).fadeToggle(1000); \/\/ Toggles the fade in\/out after 1 second\n<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">7.slideDown()<\/h3>\n\n\n\n<p>The <code>slideDown()<\/code> method slides down the selected elements, making them visible.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text\/x-php&quot;,&quot;theme&quot;:&quot;midnight&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;Javascript&quot;,&quot;language&quot;:&quot;PHP&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;php&quot;}\">$(&quot;#element&quot;).slideDown(1000); \/\/ Slides down the element after 1 second\n<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">8.slideUp()<\/h3>\n\n\n\n<p>The <code>slideUp()<\/code> method slides up the selected elements, making them hidden.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text\/x-php&quot;,&quot;theme&quot;:&quot;midnight&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;Javascript&quot;,&quot;language&quot;:&quot;PHP&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;php&quot;}\">$(&quot;#element&quot;).slideUp(1000); \/\/ Slides up the element after 1 second\n<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">9.slideToggle()<\/h3>\n\n\n\n<p>The <code>slideToggle()<\/code> method toggles the sliding of the selected elements up and down.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text\/x-php&quot;,&quot;theme&quot;:&quot;midnight&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;Javascript&quot;,&quot;language&quot;:&quot;PHP&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;php&quot;}\">$(&quot;#element&quot;).slideToggle(1000); \/\/ Toggles the slide up\/down after 1 second\n<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">10.animate()<\/h3>\n\n\n\n<p>The <code>animate()<\/code> method allows you to create custom animations by changing CSS properties over time.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text\/x-php&quot;,&quot;theme&quot;:&quot;midnight&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;Javascript&quot;,&quot;language&quot;:&quot;PHP&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;php&quot;}\">$(&quot;#element&quot;).animate({ left: '250px', opacity: 0.5 }, 1000); \/\/ Animates left position and opacity after 1 second\n<\/pre><\/div>\n\n\n\n<p>jQuery includes a number of animation effects that can add user attraction to your web pages. Many <strong>jQuery animation <\/strong>methods allow you to easily incorporate interaction and enchance the visual appeal of your web pages. These effects allow for smooth and captivating user experiences.<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:#e4ecf4\">If you&#8217;re planning to build a feature-rich online platform, explore our <a href=\"https:\/\/www.appfinz.com\/web-portal-development\"><strong>web portal development<\/strong><\/a> and <a href=\"https:\/\/www.appfinz.com\/b2b-portal-development\"><strong>B2B portal solutions<\/strong><\/a> tailored for scalability and performance.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello Nerds, jQuery provides several built-in jQuery animation effects, which make it easy for us<\/p>\n","protected":false},"author":1,"featured_media":492,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[150],"tags":[],"class_list":["post-1081","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-jquery"],"_links":{"self":[{"href":"https:\/\/www.appfinz.com\/blogs\/wp-json\/wp\/v2\/posts\/1081","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appfinz.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appfinz.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appfinz.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appfinz.com\/blogs\/wp-json\/wp\/v2\/comments?post=1081"}],"version-history":[{"count":6,"href":"https:\/\/www.appfinz.com\/blogs\/wp-json\/wp\/v2\/posts\/1081\/revisions"}],"predecessor-version":[{"id":1363,"href":"https:\/\/www.appfinz.com\/blogs\/wp-json\/wp\/v2\/posts\/1081\/revisions\/1363"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.appfinz.com\/blogs\/wp-json\/wp\/v2\/media\/492"}],"wp:attachment":[{"href":"https:\/\/www.appfinz.com\/blogs\/wp-json\/wp\/v2\/media?parent=1081"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appfinz.com\/blogs\/wp-json\/wp\/v2\/categories?post=1081"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appfinz.com\/blogs\/wp-json\/wp\/v2\/tags?post=1081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}