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
- <Div class = "banner">
- <Div class = "inside">
- <A href = "http://www.jquery001.com/">
- <Span> jQuery Learning Series </span>
- </A>
- </Div>
- </Div>
JQuery code, height position initialization:
The most professional UI front-end framework!
. Code
- Var I = 0; var j = 65; var m = 0;
- Var arrTop = new Array (74, 71, 65, 50, 35, 14,-15); // initialization height
- $ (". Inside a"). each (function (){
- // Initialization location
- $ (This). find ("img"). hide ();
- $ (This). find ("span"). show ();
- I = I + 80;
- MarginLeft = I + "px ";
- MarginTop = arrTop [m] + "px ";
- M ++;
- Optional (this).css ({"left": marginLeft, "top": marginTop });
- });
Introduce the easing Library: the most professional UI front-end framework!
. Code
- Var easing = "easeInSine", // introduces the easing ui to increase the dynamic effect.
- Duration= 200,
- Animation = {
- Width: 120,
- Height: 120,
- MarginLeft:-30,
- MarginTop:-30
- };
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>