Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@barneycarroll
Created September 30, 2011 10:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barneycarroll/1253391 to your computer and use it in GitHub Desktop.
Save barneycarroll/1253391 to your computer and use it in GitHub Desktop.
Force hasLayout toggle
// Force hasLayout: wait til after page load, toggle zoom moments later
$.fn.hasLayout = function(){
var
$el = $(this),
zoom = function(){
$el.css('zoom','0').css('zoom','1');
},
delay = function(x){
setTimeout(x,100);
};
$().addLoad(delay(zoom));
return $el;
};
// Force hasLayout: wait til after page load, toggle zoom moments later
$.fn.hasLayout = function(){
var
$el = $(this),
zoom = function(){
$el.css('zoom','0').css('zoom','1');
},
delay = function(x){
setTimeout(x,100);
};
addLoad(function(){delay(zoom)});
return $el;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment