jQuery bouncing image
I have a requirement, wherein, the client want's an image to bounce, currently I'm using this
$(window).ready(function () {
$('#homePageImage').stop()
开发者_运维百科 .animate(
{
height: '370px'
},
{ queue: false,
duration: 1000,
easing: 'easeOutBounce' });
});
But, the client wants the entire image to "fall down" and bounce, how can it be done?
Thank you !
I'm not sure what you're asking mate really...
here are two potential solutions:
Include Jquery ui - easeOutBounce is a jquery ui component and not included in stock jquery.
Make #homePageImage
position: absolute
and animate thetop:
value not theheight:
. That way the image will fall down and bounce. You'll have to start with the image attop: -*height of the image*
so its just off the screen and then animate it totop: *where you want it*
with the easingeaseOutBounce
. :)
精彩评论