Skip to content

Instantly share code, notes, and snippets.

@dustintheweb
Created July 18, 2013 15:50
Show Gist options
  • Save dustintheweb/6030460 to your computer and use it in GitHub Desktop.
Save dustintheweb/6030460 to your computer and use it in GitHub Desktop.
Ternary (Conditional) Operator and Style. Useful for rendering an inline if statement
// Psuedo:
(some_condition) ? do_something_simple : do_something_else;
// Example within an API
$('.featured-carousel .carousel').carouFredSel({
scroll: {
fx: ($('html').hasClass('ie8'))?'scroll':'crossfade'
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment