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

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -