I found the js library for easing functionality, but somehow it won't work...

here is the jsfiddle i created.

jsfiddle

  $(".top").click(function(){
        $(".top").animate({ left: '100px' }, 600, 'easeOutBack');
  });

(it doesn't have the js/easing.js option tho)

I was trying to implement the bouncing up and down animation for a div when clicked. Any help would be appreciated!

有帮助吗?

解决方案

I have updated your jsfiddle to do what you want:

http://jsfiddle.net/qy57G/7/

Im using jquery 1.9.1 with jquery.ui 1.9.2

$(".top").on('click', function () {
    $(".top").animate({
        left: '100px'
    }, 600, 'easeOutBack');

});

In addition i removed your float css and added position: relative as you are animating to a position.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top