1

この jQuery イージング プラグインが機能しないようです。私はhttp://easions.net/でそれを見ました、そして私は自分のコードでhttp://jsfiddle.net/XqqtN/にフィドルを持っています

私はこれが初めてです助けてください!

$("#coolDiv").animate({'top':'-300px'},600,'easeOutBack',function(){ $(this).css({'top':'310px'});

4

1 に答える 1

3

Using the jQuery easing plugin should work:

#coolDiv {
    width: 50px;
    height: 50px;
    position: absolute;
    top: 0;
    right: 0;
    background: yellow;
}

<div id="coolDiv">cool</div>

var left = $('#coolDiv').offset().left;

$("#coolDiv").css({left:left}).animate({"left":"0px"}, { duration: 1500, easing: "easeOutBack" });

Note that the main difference is adding { duration: 1500, easing: "easeOutBack" } to the animate function.

Fiddle

于 2013-06-11T16:46:54.723 に答える