JQuery images become more elastic and jquery images become more elastic

Source: Internet
Author: User

JQuery images become more elastic and jquery images become more elastic

In this article, when the cursor is placed on a specific a label, a circular image background is displayed. This special effect can be used for website navigation. The specific effect can be seen from:

 

HTML code:

. Code
  1. <Div class = "banner">
  2. <Div class = "inside">
  3. <A href = "http://www.jquery001.com/">
  4. <Span> jQuery Learning Series </span>
  5. </A>
  6. </Div>
  7. </Div>

JQuery code, height position initialization:

 

The most professional UI front-end framework!

. Code
  1. Var I = 0; var j = 65; var m = 0;
  2. Var arrTop = new Array (74, 71, 65, 50, 35, 14,-15); // initialization height
  3. $ (". Inside a"). each (function (){
  4. // Initialization location
  5. $ (This). find ("img"). hide ();
  6. $ (This). find ("span"). show ();
  7. I = I + 80;
  8. MarginLeft = I + "px ";
  9. MarginTop = arrTop [m] + "px ";
  10. M ++;
  11. Optional (this).css ({"left": marginLeft, "top": marginTop });
  12. });

Introduce the easing Library: the most professional UI front-end framework!

. Code
  1. Var easing = "easeInSine", // introduces the easing ui to increase the dynamic effect.
  2. Duration= 200,
  3. Animation = {
  4. Width: 120,
  5. Height: 120,
  6. MarginLeft:-30,
  7. MarginTop:-30
  8. };

 


With Jquery, how does one make the image in the Div gradually become larger and smaller? Can you help me?

I have not downloaded this js script.

Use the jqueryeasingjs plug-in of jquery to write down the Spring Effect --

Easing. js has the following effects:
Jswing
Def
EaseInQuad easeOutQuad easeInOutQuad
EaseInCubic easeOutCubic easeInOutCubic
EaseInQuart easeOutQuart easeInOutQuart
EaseInQuint easeOutQuint easeInOutQuint
EaseInSine easeOutSine easeInOutSine
EaseInExpo easeOutExpo easeInOutExpo
EaseInCirc easeOutCirc easeInOutCirc
EaseInElastic easeOutElastic easeInOutElastic
EaseInBack easeOutBack easeInOutBack
EaseInBounce easeOutBounce easeInOutBounce
What is the specific effect?
From the above, we can see that each type is divided into In Out InOut
In: indicates that the animation has this effect at the beginning.
Out: This effect is achieved when the animation ends.
InOut: indicates that the animation starts and ends with this effect.
Elastic: Spring Effect (easeInElastic [start spring], easeOutElastic [end Spring], easeInOutElastic [start spring and end Spring])
Usage:
<Script type = "text/javascript" language = "javascript" src = "JS/jquery. js"> </script>
<Script type = "text/javascript" language = "javascript" src = "JS/easing. js"> </script>
<Script language = "javascript" type = "text/javascript">
$ (Document). ready (function (){
$ ("# Xxxx"). stop (true, false). animate ({left:-320}, 1500, 'easeoutelastic ');
})
</Script>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.