jQuery ट्यूटोरियल

jQuery होम jQuery परिचय jQuery आरंभ करें jQuery सिंटेक्स jQuery चयनकर्ता jQuery की घटनाएँ

jQuery प्रभाव

jQuery छुपाएं/दिखाएं jQuery फीका jQuery स्लाइड jQuery चेतन jQuery स्टॉप () jQuery कॉलबैक jQuery चेनिंग

jQuery एचटीएमएल

jQuery प्राप्त करें jQuery सेट jQuery जोड़ें jQuery निकालें jQuery सीएसएस कक्षाएं jQuery सीएसएस () jQuery के आयाम

jQuery ट्रैवर्सिंग

jQuery ट्रैवर्सिंग jQuery के पूर्वज jQuery के वंशज jQuery भाई बहन jQuery फ़िल्टरिंग

jQuery AJAX

jQuery AJAX परिचय jQuery लोड jQuery प्राप्त करें/पोस्ट करें

jQuery विविध

jQuery नो कॉन्फ्लिक्ट () jQuery फिल्टर

jQuery के उदाहरण

jQuery के उदाहरण jQuery प्रश्नोत्तरी jQuery व्यायाम jQuery प्रमाणपत्र

jQuery संदर्भ

jQuery अवलोकन jQuery चयनकर्ता jQuery की घटनाएँ jQuery प्रभाव jQuery एचटीएमएल/सीएसएस jQuery ट्रैवर्सिंग jQuery AJAX jQuery विविध jQuery गुण

jQuery चेतन () विधि

jQuery प्रभाव के तरीके

उदाहरण

"चेतन" एक तत्व, इसकी ऊंचाई बदलकर:

$("button").click(function(){
  $("#box").animate({height: "300px"});
});

परिभाषा और उपयोग

एनिमेट () विधि सीएसएस गुणों के एक सेट का एक कस्टम एनीमेशन करती है।

यह विधि सीएसएस शैलियों के साथ एक तत्व को एक राज्य से दूसरे राज्य में बदलती है। एनिमेटेड प्रभाव बनाने के लिए CSS गुण मान को धीरे-धीरे बदला जाता है।

केवल संख्यात्मक मान एनिमेटेड हो सकते हैं (जैसे "मार्जिन: 30px")। स्ट्रिंग मान एनिमेटेड नहीं हो सकते (जैसे "पृष्ठभूमि-रंग: लाल"), स्ट्रिंग्स "शो", "छिपाने" और "टॉगल" को छोड़कर। ये मान एनिमेटेड तत्व को छिपाने और दिखाने की अनुमति देते हैं।

युक्ति: सापेक्ष एनिमेशन के लिए "+=" या "-=" का उपयोग करें।


वाक्य - विन्यास

(selector).animate({styles},speed,easing,callback)

Parameter Description
styles Required. Specifies one or more CSS properties/values to animate.

Note: The property names must be camel-cased when used with the animate() method: You will need to write paddingLeft instead of padding-left, marginRight instead of margin-right, and so on.

Properties that can be animated:


Only numeric values can be animated (like "margin:30px"). String values cannot be animated (like "background-color:red"), except for the strings "show", "hide" and "toggle". These values allow hiding and showing the animated element.
speed Optional. Specifies the speed of the animation. Default value is 400 milliseconds

Possible values:

  • milliseconds (like 100, 1000, 5000, etc)
  • "slow"
  • "fast"
easing Optional. Specifies the speed of the element in different points of the animation. Default value is "swing". Possible values:
  • "swing" - moves slower at the beginning/end, but faster in the middle
  • "linear" - moves in a constant speed
Tip: More easing functions are available in external plugins.
callback Optional. A function to be executed after the animation completes. To learn more about callback, please read our jQuery Callback chapter


वैकल्पिक सिंटैक्स

(selector).animate({styles},{options})

Parameter Description
styles Required. Specifies one or more CSS properties/values to animate (See possible values above)
options Optional. Specifies additional options for the animation. Possible values:
  • duration - sets the speed of the animation
  • easing - specifies the easing function to use
  • complete - specifies a function to be executed after the animation completes
  • step - specifies a function to be executed for each step in the animation
  • progress - specifies a function to be executed after each step in the animation
  • queue - a Boolean value specifying whether or not to place the animation in the effects queue
  • specialEasing - a map of one or more CSS properties from the styles parameter, and their corresponding easing functions
  • start - specifies a function to be executed when the animation begins
  • done - specifies a function to be executed when the animation ends
  • fail - specifies a function to be executed if the animation fails to complete
  • always - specifies a function to be executed if the animation stops without completing

इसे स्वयं आज़माएं - उदाहरण


का उपयोग करना एनीमेशन को दोहराने वाले कॉलबैक फ़ंक्शन के साथ एनिमेट () का उपयोग कैसे करें।


एकाधिक एनीमेशन शैलियों और विकल्पों को निर्दिष्ट करने के लिए वैकल्पिक सिंटैक्स का उपयोग करना।


के लिए चेतन () विधि का उपयोग कैसे करें।


में स्मूथ स्क्रॉलिंग जोड़ें लिंक में स्मूथ स्क्रॉलिंग जोड़ने के लिए एनिमेट () का उपयोग कैसे करें।


jQuery प्रभाव के तरीके