开发者

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

开发者 https://www.devze.com 2023-04-03 05:17 出处:网络
I have the following javasc开发者_如何学Goript variables... var pixelTop = ui.value; var pixelTop = (pixelTop) * (-1);

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

精彩评论

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

关注公众号