Skip to content

Instantly share code, notes, and snippets.

@mcheck
Created May 20, 2011 20:40
Show Gist options
  • Save mcheck/983751 to your computer and use it in GitHub Desktop.
Save mcheck/983751 to your computer and use it in GitHub Desktop.
js to toggle the blueprint grid
$(document).ready(function() {
$("body").append("<div id='debug'>turn grid: <a href='' id='togglegrid'>" + gridstate() + "</a></div>");
$("#debug").css("position", "absolute");
$("#debug").css("bottom", "0");
$("#togglegrid").click(toggle_grid);
});
function toggle_grid () {
$(".container").toggleClass("showgrid");
$("#togglegrid").text(gridstate());
return false;
}
function gridstate () {
if ($(".container").hasClass("showgrid")) {
return 'off';
} else {
return 'on';
};
}
@mcheck
Copy link
Author

mcheck commented May 20, 2011

Use to toggle the blueprint grid.
Just include in app controller views: <%= javascript_include_tag 'blueprint_showgrid.js' %>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment