grid960 bookmarklet – now with 24 columns

I recently received a request to update the grid960 bookmarklet to support 24 columns. I hadn’t realised that 960.gs had been updated.

So, here it is!

To install the bookmarklet simply drag the link below to your bookmarks toolbar. In Internet Explorer, right click, select ‘Add to favourites’ and then select ‘Links’.

grid960

For further information on this bookmarklet, see my previous post

Tags: , ,

8 Comments

Johannes commented on December 1st, 2010 at 10:20 am

Many thanks for this great tool! :-)

Billee D. commented on December 10th, 2010 at 1:07 am

Great tool, Howie, and thanks for sharing. However, I noticed that when you have a layout with absolutely positioned elements the grids never show up. I’m going to try playing around with the script a bit and I’ll post back here what I find out. :)

Richard Davies commented on January 31st, 2011 at 9:49 pm

The jQuery detection logic you use now checks for a version of jQuery that is no longer the most recent version. So even if I’ve already loaded the latest version of jQuery the bookmarklet still loads v1.4.2.

Perhaps instead of explicitly checking for v1.4.2 you should use feature detection to check for whatever critical feature it is that you need in v1.4.2 and then load jQuery only if that feature doesn’t exist. Since that feature will still exist in later versions it won’t overwrite newer versions of jQuery.

badlyDrawnToy commented on February 2nd, 2011 at 4:33 pm

Good point Richard. Gosh, I hardly use this tool as I don’t do much front-end development these days, but clearly others like it. Now that jQuery 1.5 is out I’ll have a rethink.

The tool is only used for development, so loading the extra library on the fly isn’t a biggest crime. The important thing is that it does not conflict with an in place library. Most people developing a site will be using the latest jQuery release. Perhaps I should just use the latest.

Shame that none of the CDN versions are labelled ‘latest’ :-/

Richard Davies commented on February 3rd, 2011 at 5:15 am

Actually, the Google CDN does have a ‘latest’ version. Just use https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js and it will always serve the latest 1.x version. (They haven’t upgraded to 1.5 yet as it was just released the other day…)

Dan Jallits commented on May 2nd, 2011 at 11:26 pm

How does one extending the grid past the initial page fold? I am on Firefox 4.0.1 (Mac-Intel)

Andrew commented on May 23rd, 2011 at 3:19 am

Is it possible to play with the alignment of the grid overlay? For example, shift it x number of pixels to the left or right? It might just be the site I am looking at, but nothing lines up with the grid, including the main content area. If I can shift the grid to align with the content area, then I can at least determine if the elements are out of whack or the whole page is out of whack…

vanita singh commented on May 23rd, 2011 at 9:52 am

This tool is wonderful.Many thanks for sharing.

960.gs grid overlay – a jQuery plugin

I’ve now released a bookmarklet to provide a simpler gird overlay.
Please also see grid960 – a grid overlay bookmarklet for 960.gs

I’ve been using 960.gs on a few sites recently. Without wanting to get into a discussion about the pros/cons of using css grid frameworks, I find them useful for some sites.

The 960.gs framework comes with a handy demo that shows a grid overlay, but the GIF images used have no transparency, so it is difficult to add a nice grid overlay to sites when developing them.

On the 960.gs home page there is a button by the thumbnail examples that dynamically adds a grid to the image. I Googled around for a similar solution, but didn’t find one that quite did what I wanted. So, I decided to build a simple jQuery plugin of my own.

Here’s a demo of the plugin in action.

To use the plugin, simply add the following code to your pages for a 12 column grid:


<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery.960grid-1.0.min.js"></script>
<script type="text/javascript">
	$(function() {
		$("body").addGrid(12);
	});
</script>

thumbnail of 960grid plugin

Once the plugin is activated, a small toggle link will be visible in the top left-hand corner of the page. Unsurprisingly, if you change the input parameter from 12 to 16, you get a 16 column grid available!

The plugin relies on a couple of PNGs and by default the image path is set to /images/. You can override this setting, along with several others, by passing in some options as follows:


var options= {
	img_path: 'img/',
	z_index: 999,
	opacity:.6
};
$("body").addGrid(12, options);

As well as the image path, it is possible to override the default z-index used by the overlay, in case there is a conflict. You can also alter the opacity of the PNG if you require.

Please feel free to download the plugin for your own use. Let me know of any problems or suggested enhancements.

Tags: , , ,

17 Comments

Remy Sharp commented on April 21st, 2009 at 10:05 am

Why not convert this to a bookmarklet – seems like a perfect candidate so that anyone can plug it to their site on the fly to check it matches the grid.

You can easily toggle it via the bookmarklet too, but just checking for a particular id in the body.

Jason Huck commented on April 22nd, 2009 at 1:50 pm

Thanks, this looks pretty handy. I’ll second Remy’s suggestion of making it a bookmarklet, too.

- jason

badlyDrawnToy commented on April 22nd, 2009 at 1:57 pm

Thanks for the feedback. A bookmarklet is on it’s way

Razvan Segarceanu commented on April 22nd, 2009 at 2:10 pm

Multumesc! (that means thank you very much, in Romanian :P )

HTML Editor Reviews » Two New CSS Framework Tools commented on April 22nd, 2009 at 3:29 pm

[...] I’ve been trying out for the last little while, there’s a new jQuery plug-in called 960.gs grid overlay that does as the name implies — it overlays a semi-transparent 960 grid over your layout as [...]

Blueprint grid overlay - a jQuery plugin | Caldeas Blog commented on April 22nd, 2009 at 10:11 pm

[...] I saw a link on Twitter for a jQuery plugin written by badlyDrawnToy that allows you to toggle the grid overlay when using [...]

網站製作學習誌 » [Web] 連結分享 commented on April 24th, 2009 at 3:33 am

[...] 960.gs grid overlay – a jQuery plugin [...]

[...] basas tus diseños web en columnas utilizando el Framework de CSS 960.gs, 960.gs grid overlay, un plugin para jQuery puede resultarte bastante [...]

Andrée Hansson commented on April 26th, 2009 at 3:31 am

Hey! Looks neat, I have been working on a very similar project for two months now (check the link), just to let you know. :-)

My Thoughts on 960gs | Tom McFarlin commented on April 27th, 2009 at 10:05 am

[...] jQuery plug-in for the 960gs grid overlay [...]

ling commented on December 21st, 2009 at 11:37 pm

1000 thanx
badlyDrawnToy,
most convenient tool for me!!

Philsbury commented on December 30th, 2009 at 4:26 pm

I love this. Need I say more? :)

Daniel Shanahan commented on January 26th, 2010 at 3:29 am

I like this very much – thank you for making it available. I found what may be a bug. I was not able to implement the plugin, even though I followed the instructions to the letter. I ended up duplicating the demo and started from scratch, as the demo worked. Then, as I was marking up the demo.html I came across this behavior: within the container div I have a sidebar div. I gave the sidebar div an id of ‘sidebar’. So far, so good. However, when I gave that same div a class of ‘grid_4′, the grid no longer worked.

Perhaps this isn’t a bug and I am just unclear on the expected behavior. Any thoughts?

badlyDrawnToy commented on January 26th, 2010 at 9:59 am

Daniel. Glad you like the plugin. Not sure if what you describe is a bug. The plugin simply overlays the grid. It will not affect your own grid classes. More likely you haven’t quite got your own markup correct. Hard for me to say without you showing me your code.

Daniel Shanahan commented on January 26th, 2010 at 4:23 pm

Thanks for the quick reply. Yes, the problem could very well be my markup. Would you mind taking a look? I have two simple Lorem Ipsum sites: one where the grid works (http://www.gridoveryes.newleafdata.com/demo.html) and one where it does not (http://www.gridoverno.newleafdata.com/demo.html). All the files (css, images, js) are the exact same as the demo downloaded here, though I changed the content in the html file. The only difference between the one that works and the one that does not work is an added a class: grid_4 to the sidebar div.

Any ideas why it doesn’t work here (http://www.gridoverno.newleafdata.com/demo.html)?

Thanks.

badlyDrawnToy commented on January 27th, 2010 at 12:55 am

Daniel. I think the problem is that you have a 12 column container within which you only define a 4 column grid. You need to specify what happens with the other 8 columns e.g. make the content div 8 cols wide

also, lose the footer tags in the HTML

Good luck

Daniel Shanahan commented on January 27th, 2010 at 6:15 pm

Thanks Howie. I added grid_8 to the content div, but no luck on getting the grid to show. (I also removed the footer tags). Any other suggestions?

Colophon

badlyDrawnToy is the blog of Howie Weiner, a Manchester based freelance web developer.

Howie specialises in Django, PHP and Java web application development.

This site is no longer updated. You can now follow Howie at howieweiner.co.uk

View Howie Weiner's profile on LinkedIn
View Howie's twitter feed

Tags

Destinations