Abel Tamayo schrieb:
> Thanks a lot. It worked pretty well although i'm working on some bugs
> now. Didn't understand why you use the operator ||0, but I guess I'm not
> that good at JavaScript anyway.
> Thanks again.
It's a fallback in case parseInt returns NaN ("Not a number") for some
reason, so that you get a better value to work with (for example if some
follow-up code relies on that value being a number).
If the 0 is not reasonable either you could do something like this:
var newWidth = parseInt(oldWidth);
if (!isNaN(newWidth)) {
// process newWidth
}
-- Klaus
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/