Created
August 22, 2011 20:02
-
-
Save wyattdanger/1163371 to your computer and use it in GitHub Desktop.
Poppa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Before Big Poppa */ | |
if ( $('ul.tabs').size() ) { | |
// do stuff | |
} | |
if ( $('a[href^=http]').size() ) { | |
// do stuff | |
} | |
if ( $('#fancy-page').size() ) { | |
// do stuff like require(['fancy-page-script.js']); | |
} | |
/* After Big Poppa */ | |
$.poppa({ | |
'a[href^=http]': function (a) { | |
// do something with each external anchor in the DOM, | |
// jQuery object $('a[href^=http]') available locally as a | |
}, | |
'ul.tabs': function (ul) { | |
// do something with each ul.tabs | |
// jQuery object of $('ul.tabs') available locally as ul | |
}, | |
'#fancy-page': function () { | |
// do stuff like require(['fancy-page-script.js']); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment