开发者

how do I turn a jquery ui.value number into a negative value?

I have the following javasc开发者_如何学Goript variables...

var pixelTop = ui.value;
var pixelTop = (pixelTop) * (-1);

If I try to make the ui.value value negative (i'm using it in another function), it doesn't seem to work. How can I use a negative value here?


var pixelTop = ui.value;
if( pixelTop > 0 )
    pixelTop *= -1;


what does ui.value look like? Just a number? Or something like "58px" ?

If its just a number, it should work..

http://jsfiddle.net/wesbos/2yVDb/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜