jquery - What does: "$("#somediv").css('top', pos > 0 ? pos : 0);" mean -
i have jquery expression toolbar.css('top', pos > 0 ? pos : 0);
... pos
numeric variable calculated above (but not shown here, it's not relevant).
i trying work out pos > 0 ? pos : 0
means?
can help.
if pos greater 0, return pos, otherwise return 0
its called ternary operation: http://en.wikipedia.org/wiki/ternary_operation
Comments
Post a Comment