Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // because I just needed the function to run once, then assign it -
- // I knew that I'd never need to run it manually again, so here I
- // extended the Function prototype :)
- Function.prototype.runReturn = function (scope) {
- this.call(scope);
- return this;
- };
- // for example:
- $(document).on('orientationchange', function () {
- $('body').removeClass('portrait landscape').addClass(window.innerWidth < window.innerHeight ? 'portrait' : 'landscape');
- }.runReturn());
Add Comment
Please, Sign In to add comment