English 中文(简体)
j Query.easing - CleanOutCubic - 强调缓解措施
原标题:jQuery.easing - easeOutCubic - emphasizing on the ease

I m using the jQuery easing plugin by Robert (http://gsgd.co.uk/sandbox/jquery/easing/) and I need to emphasizing or drag out the ease effect.

基本上,我希望这种轻松的效果真正迅速,但随后在缓解期间大大放慢。

我认为,我可以使用<条码>j Query.easing.easeOutCubic(无效,目前——时间,开始——价值,最终——价值,总——时间)

如何做到这一点?

最佳回答

你们不需要宽松的花.,来做习俗的放松。 你们只需要一个缓解功能的源头 Java本。

此处为<代码>easeOutCubic功能,从j Query UI来源代码获得。 见。 以上为

$.easing.easeOutCubic = function (x, t, b, c, d) {
    return c*((t=t/d-1)*t*t + 1) + b;
}

现在,你可以篡改职能和(或)重新命名。

$.easing.myEasing = function (x, t, b, c, d) {
    return c*((t=t/d-1)*t*t + 1) + b;
}

(以下所有例子均使用375平方尺蓝皮,其编号为>/code>,期限为3秒。 你可以改变3秒(3 000平方米)的时间,以显示对贵方的影响。 我选择了3秒,使其速度放慢,足以看到差异。

然后,你就把它放在了你 j子里,这或许就是这样。

$(document).ready(function(){

        $.easing.myEasing = function (x, t, b, c, d) {
            return c*((t=t/d-1)*t*t + 1) + b;
        }

        $("#button").click(function() {
            $( #myDiv ).slideToggle(
                3000, // <-- Animation Duration (3000 ms)
                 myEasing   // <-- the Name of your easing function
            );
        });

});

以上编码的缩略语包括:easeOutCubic功能,改名为myEasing,并应用于slide Toggle( cube, 期限为3年。

http://jsfiddle.net/kJZxQ/

Ok, now to your issue: You said that you want "...the ease effect to be really quick but then slow down greatly during the ease out."

Here is a graph of easeOutCubic: easeoutcubic

你有两种选择,你可以操纵缓解模式本身,或者我们能够看到,其他一些缓解功能是否具有类似的曲线,但 steep(法斯特)直到部分放松。

This demo page visually shows you all the easing curves...

http://api.jqueryui.com/easings/"rel=“nofollow noreferer”>http://api.jqueryui.com/easings/

如你所知,几个曲线类似(7)-<条码>,但是在前端 steep。 以下是几个例子......


(10)-easeOutQuart easeoutquart easeOutQuart Demo


(13)-easeOutQuint easeoutquint easeOutQuint Demo


(16)-easeOutExpo easeoutexpo easeOutExpo Demo


如同最后一种,easeOutExpo是现有最庞大的库存功能。 通过比较上述等值的差异,我们还可以操纵<编码>easeOutExpo<>code>等值,使曲线进一步.。

这种习俗非常迅速,从而大大放慢......

http://jsfiddle.net/kJZxQ/11/

甚至比过去更极端......

http://jsfiddle.net/kJZxQ/12/

Duration increased on last demo to 6 seconds to exaggerate the effect...

http://jsfiddle.net/kJZxQ/13/

通过比较上述示威游行的数学等值,你可以看到,正在操纵哪些变量来提高效果,并相应调整你自己。

I really think easeOutExpo is more like what you describe. Essentially, it s your easeOutCubic equation but only faster on the front and slower on the end.

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签