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/
精彩评论