Hi everyone, can the someone tell me what the meaning of the colon ) and the question mark (?) is in the following line of code? var $next = $active.next().length ? $active.next() : $('#slideshow IMG:first');[CODE] Code (markup): [/CODE] I got the code from this tutorial: http://jonraasch.com/blog/a-simple-jquery-slideshow Thanks
That's an inline if: If true, do the thing before the question mark, otherwise do the thing after the colon. IOW, if $active.next() has a length (is not 0) $next = $active.next(), else $next = $('#slideshow IMG:first'). It's JS, not jQuery. (Only the $('#slideshow IMG:first') part is jQuery.) The syntax (aside from the jQuery part) is the same in PHP.
Slight edit (what I said is actually pretty stupid): If true, do the thing after the question mark, otherwise do the thing after the colon. The thing before the question mark is what you're testing.
I thought that was what you meant. I vaguely remember seeing this in a tutorial some time ago. Can you point me to one or more tutorials on this? again Thank You
I found the jquery concepts explained in a much precise way here. May be you can fine the answers here. http://www.hscripts.com/tutorials/jquery/index.php