Skip to content

Instantly share code, notes, and snippets.

var myObject = (function() {
// private stuff
var private = 'foo';
return {
publicFunction: function() {alert(private);},
public: 'bar'
};
@sashasklar
sashasklar / maximize.jquery.js
Created February 8, 2011 23:39
jQuery snippet for making an element "full screen" in mobile browsers. Includes hiding the address bar and silencing scroll events in jQuery Mobile.
(function($) {
$.maximize = function() {
var $body = $('body');
// prevent scrollstart and scrollstop events from fireing in jquery mobile
if ($.event.special.scrollstart) {
$.event.special.scrollstart.enabled = false;
}
// expand the body so there's enough room for the address bar to scroll out of view