Created
July 29, 2011 13:59
-
-
Save chrisgaunt/1113849 to your computer and use it in GitHub Desktop.
Bookmarklet to apply grids (requires jQuery on the site)
This file contains 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
javascript:(function($){var width=990;var columns=25;var gutter=10;var column_width=(width-(gutter*(columns-1)))/columns;var grid_container=$('<div id="grid-container"></div>');grid_container.css('z-index','999999');grid_container.css('position','absolute');grid_container.css('top',0);grid_container.css('left',0);grid_container.css('width','100%');grid_container.css('height',$(document).height()+'px');var grid=$('<div id="grid"></div>');grid.css('width',width+'px');grid.css('margin','0 auto');var column=$('<div id="column"></div>');column.css('height',$(document).height()+'px');column.css('background-color','rgba(50,150,255,.2)');column.css('width',column_width+'px');column.css('float','left');column.css('margin-left',gutter+'px');grid.append(column.clone().css('clear','left').css('margin',0));for(var i=0;i<(columns-1);i++){column.clone().appendTo(grid);};grid_container.append(grid);$('body').append(grid_container);}(jQuery)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment