English 中文(简体)
j 习俗价值(非捷克统计局财产)的量化
原标题:jQuery animate of custom value (not a CSS property)

我想做的是最奇怪的事情:做的是价值改变,而做的是一只mate子,但只是一个变数。

我需要这样做,因为当用户在边境点击时,我想轮换一个要素。 因此,我需要调整角值,然后在海关计算算法中使用。

我试图使用隐蔽的DVD的财产,仅仅是为了储存其角值和与之相容,但这样做并不合适。

谁能帮助我?

最佳回答

在寻找同一东西和正确答案时,仅仅 st倒了。

$({foo:0}).animate({foo:100}, {
    step: function(val) {
        // val takes values from 0 to 100 here
    }
})

http://james.padolsey.com/javascript/fun-with-jquerys-animate/>。

问题回答

简言之,不可能运行<代码>atmate功能,而实际上没有为该中心提供某些财产以供其工作(它没有给你在两者之间的数值)。

您甚至没有必要对实际要素(或变量)进行估算,希望加以改变,以便利用“Andrew”所描述的<条码>分步骤论点开展工作:

$( <div/> ).css({ height: _your_start_value }).animate({
    height: _your_end_value
}, { 
    step: function (currentValue) {
        //do what you need to with the current value..
    }
});

However, this is pretty inefficient as it s changing the (although unattached) element s height CSS property needlessly. It s better to just use a "tweening" library such as Tween JS to do this kind of thing.

如果你看上“钥匙”,请上,因此,请上。 页: 1 履历:





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

Drop down background url in Safari Issue

selectBox.selectCSS { background: url(/Images/replacementSelectBackground.png) top left no-repeat height:auto; } I have an issue in Safari only where the image is not rendering on top ...

CSS specific for Safari

How do you target specifically safari in css with styles?

Aligning textarea in a form

Ive used the following css code to align my form elements: form { position:relative; } form input { position:absolute; left:11em; } However, the textarea element is not aligned correctly with the ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

CSS problem with page footer

I have defined my page footer in the css file as: #footer { position: absolute; height: 50px; text-align: center; background: #66CCCC; bottom: 0px; left: 0px; width: 100%; height: ...

热门标签