Skip to content

Instantly share code, notes, and snippets.

@elsassph
Created June 29, 2012 05:53
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elsassph/3016097 to your computer and use it in GitHub Desktop.
Save elsassph/3016097 to your computer and use it in GitHub Desktop.
jQuery shorthand for haxe 'using'
class JQ
{
static public inline function select(j:js.Dom.HtmlDom):js.JQuery
{
return new js.JQuery(j);
}
static public inline function query(j:String):js.JQuery
{
return new js.JQuery(j);
}
}
// imports
using JQ;
// usage
"#foo .bar".query().fadeIn();
Lib.document.body.select().addClass("baz");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment