grid960 – a grid overlay bookmarklet for 960.gs

A couple of days ago I released a jQuery plugin that provides a grid overlay when working with the 960.gs css grid framework. The plugin seems to have been quite popular, and as a result I now have a host of new Twitter followers – Hello to everyone in Romania!

I’m glad that others have found the plugin useful. A couple of people have suggested I release the overlay as a bookmarklet, so I spent yesterday learning how to develop one. So here it is: grid960 – a grid overlay bookmarklet for 960.gs

grid-bookmarklet

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

You can test it on this page.

The bookmarklet works slightly differently to the original jQuery plugin. Firstly, if jQuery is not installed, it will inject it for you. If jQuery is already installed it will use this library – it will dynamically upgrade the library if it is not the latest vesion (1.3.2).

Secondly, the bookmarklet provides a small configuration menu on the page. When the bookmarklet loads, it will defaults to the 12 column grid. Through the menu, you can switch to a 16 column grid, and also alter the opacity of the gridlines.

The bookmarklet does not work in IE6 (yeah, whatever).

Any problems or suggestions, let me know.

Tags: , , , ,

17 Comments

Ian commented on April 23rd, 2009 at 1:23 pm

Very cool and quick work on the bookmarklet implementation! As a feature suggestion would it be possible to allow the user to select the width, gutter, and columns? This would then make it useful for aligning no matter which grid your working with, not just 960.

| Caldeas Blog commented on April 23rd, 2009 at 5:51 pm

[...] badlyDrawnToy created a bookmarket for the 960.gs grid overlay. I modified it for Bluetrip. Just drag the link below to your bookmarks toolbar. In Internet Explorer, right click, select ‘Add to favourites’ and then select ‘Links’. It does not work with IE6. [...]

Simon Rumble commented on April 24th, 2009 at 7:01 am

Nice work Howie! (Google Reader filtered out your code, mind.)

Simon Rumble commented on April 28th, 2009 at 6:47 am

Very likely reason it doesn’t work in IE6 is that it has a 508 char limit on bookmarklets and yours is 657 chars. If you reduce it down to just load your library, and have all the guts in there, you’ll get under that limit:

javascript:(function(){document.body.appendChild(document.createElement(‘script’)).src=’http://www.yoursite.com/stuff/bookmarklet.js’;})();

badlyDrawnToy commented on April 28th, 2009 at 8:32 am

Simon. The code is a little more complex than simply writing in the script element, as it first loads jQuery and then the custom script.

The code fist checks to see if jQuery is already loaded; if not the script is added. If it does exist, it checks the version, and updates if necessary. One further complication, is that the code must wait for jQuery to initialise before downloaded the second custom script.

Simon Rumble commented on April 28th, 2009 at 8:39 am

Hmmm, much trickier than mine! But couldn’t all that be done in a download, which triggers further downloads? The key here is to just get the Bookmarklet component down to under 508 chars for broken IE.

(The reason I care about IE6 is it’s a critical target platform for me. It’s STILL in the SOE here. Gah! Not that I need your bookmarklet for work purposes, just had to solve the problem myself just now.)

badlyDrawnToy commented on April 28th, 2009 at 8:48 am

@Simon – Yes, I guess I could/should have done this. I decided that web developers are unlikely to be designing their grid layouts in IE6. Could be wrong, which would be scary!

Seemed like overkill to make 3 HTTP requests to load the script. Here’s the code used

http://www.badlydrawntoy.com/static/960grid/js/960grid-bookmarklet.js

Simon Rumble commented on April 28th, 2009 at 8:54 am

When I first started this and was trying to get Firefox et al installed, I was told by the support people to develop in IE6 and Word… Yeesh!

The reason IE6 might be handy is for debugging a bog-standard IE6 install, which is fiendishly difficult. I find XRAY incredibly handy for this (http://www.westciv.com/xray/)

Milan Andric commented on May 5th, 2009 at 1:08 am

I’m looking for a javascript grid-based page editor, for lack of a better term. Some javascript code that takes a set of vanilla html div blocks and allows you to order them/move them/expand contract and maintains the grid system in a fixed width interface, like 12 column 960. The javascript generates the right grid code and you can save it or do an XMLHTTPRequest post to save it. Any ideas or have you seen something like this?

robert commented on May 22nd, 2009 at 12:52 am

do you have a decompressed version of the javascript so I can add a 24 colun grid option? I can likely edit it myself unless you want to add it which would be nice heh. Email me if you do, thanks.

DemoGeek commented on September 18th, 2009 at 3:48 pm

That is indeed very handy particularly with the 12 and 16 grid option. Would really help if there is a way to adjust the color overlay as if you have the same color on the page you might find it a bit harder to track it.

David commented on September 30th, 2009 at 2:29 am

Awesome. THANK YOU!

Ravoof commented on November 8th, 2009 at 9:56 am

Really useful. Thanks.

Katie Dixon commented on December 7th, 2009 at 1:50 pm

Works great and so useful! Thank you very much!

Surftipps commented on February 20th, 2010 at 9:12 pm

Absoluty perfect. Thanks

Faramarz commented on May 8th, 2010 at 11:06 am

Brilliant. It would be great if grid colours could be chosen.
Really nice job, thanks for sharing it with everybody else.

Phil commented on June 19th, 2010 at 9:19 pm

Perhaps Howie is a Manchester City supporter. He wouldn’t want to give you a choice of colour in case you chose one that wasn’t blue.

Leave a Reply

CAPTCHA Image

IE8 Rounded Corners

Also see updated post about suitable jQuery plugin

Last night I finally got round to upgrading my Win XP VMWare image from IE8 beta to the production release. A bit slack on my behalf as the browser was released about 3 weeks ago. Still, I’d been testing websites in the beta release and all was cool.

Well, that’s what I thought. Last night I discovered that my company website, no longer worked. Looking into the problem this morning, I discovered that the culprit was a jQuery plugin that renders rounded/curvy corners.

I looked at a few other plugins, but none seemed to work. After a bit of Googling, I cam across an interesting blog entry from the guys at filmanentgroup, who are heavily involved in developing the jQuery UI API.

The blog entry highlighted an interesting piece of javascript development by Drew Diller that has nothing to do with jQuery. Drew has written an IE specific library called DD_roundies, that uses VML to produce the rounded corners.

The idea is that this code be used for browsers that don’t (yet) support CSS3 border radius. However, Drew has included an option to also render the CSS3 syntax for those browsers that support this feature.

I’ve now updated my site to use Drew’s code with CSS3 syntax support. This works in IE6, IE7, IE8, Safari, FireFox and Chrome. It doesn’t yet work in Opera, but this is only a matter of time (and perhaps a code update). If you want to support Opera, you can simply use conditional comments.

Tags: , , ,

5 Comments

Alun commented on April 15th, 2009 at 11:19 pm

IE8 is no longer RC? Where have I been?

Phil Thompson commented on April 21st, 2009 at 10:28 am

I installed IE8 last week and have actually been relived to find it’s rendering engine is very good. Admittedly it’s lacking a few CSS3 features that would have made it superb but I can happily sleep at night knowing all the websites I’ve created in the past two years look great in IE8 because it now handles CSS 2 properly.

Android commented on June 20th, 2009 at 3:43 pm

I cannot believe that IE8 still not supports rounded corners…

Alberto Lepe commented on August 27th, 2009 at 5:49 am

IE its getting somehow not that bad in their 8th version, but still score pretty awful in the acid 3 test: http://acid3.acidtests.org/, which means they are far from have a standard complain browser.
If you don’t know what is “ACID 3 TEST” read: http://en.wikipedia.org/wiki/Acid3

Vaughn commented on November 13th, 2009 at 6:41 pm

Howie,

I had written DD_roundies off, because when I looked at the DD_roundies page all the VML rounded divs are about 300px right of where they belong. I figured it was broken.

You say DD_roundies is working for you in IE8 though, very strange. I visited your company homepage, and indeed, there they are. Maybe I’ll give it a try after all.

Thanks,

Vaughn

Leave a Reply

CAPTCHA Image

Goodbye Java, Hello World

As mentioned in my previous post, I’m about to move back to freelance web design, and away from full-time Java web development. As of Monday, I will no longer be a contractor, and will be partnering with Stan PR as their web technologist. So, I’ve been re-assessing my skillset, and re-examining the current state of the ever-changing world of web. I think it’s time to say goodbe to Java, and hello to a new set of web frameworks and technologies.
more »

Tags: ,

Leave a Reply

CAPTCHA Image

Speed Up Your Web Site With Firebug and YSlow

I recently convinced a friend that the Firebug plug-in for Mozilla FireFox is an essential development tool. Well, it’s now time for me to praise YSlow, an extension to Firebug provided by Yahoo!, that analyses your web site, and recommends how to improve performance in the way of download speed. So if you want to learn how to speed up your web site, read on.
more »

Tags: , ,

4 Comments

Alun Coppack commented on December 18th, 2007 at 2:04 pm

Some interesting ideas, particularly the use of HTTP Expires Headers.

I wonderif whitespace in js and css files be taken care of by gzip compression (if your host allows it)?

Also, does reducing the number of requests speed up the site? I thought that multiple requests (executed concurrently) would not take any longer.

Oh, and the link to ‘my company website’ is to yslow instead :(

Steven commented on December 18th, 2007 at 2:30 pm

Now tell that to the rest of the bloated crap on the internet :-)

howie commented on December 18th, 2007 at 2:34 pm

Judging by the CSS and JS files viewable in FireBug, I don’t think that whitepsace is actually stripped away, but it would be compressed. ‘Packing’ such files before placing them on the server would have the beenefit of require less process deflating and inflating.

Browsers limit the number of simultaneous connections. IE (ghasp) actually follows the spec (RFC) and limits HTTP 1.1 to 2 simultaneous connections. See connections. Firefox’s about:config show 8 max connections and 2 max persistent connections. I guess persistent is for HTTP 1.1/keep. alive. Opera used to be set to 8, but I’ve not used it for a while.

Link updated. Cheers Alun

Rich commented on December 19th, 2007 at 10:32 pm

Nice work Howie!
The work website I am involved in (you know it) used to buckle under peak loads of around 80,000 users in a 15 minute period.

After some relatively simple optimisation, we can now successfully serve 160,000 and counting – we’ve yet to see our new limit (or generate it from load-testing).

That was simply combining css / js files, reviewing cache-control directives, removing unnecessary images and tidying up crappy html.

Other suggestions at the time ranged from getting a bigger pipe (this wouldn’t have helped) to using Akamai.

Are the two weeks up yet, is it too late?

  • rich

Leave a Reply

CAPTCHA Image

Colophon

badlyDrawnToy is the blog of Howie Weiner, a knackered, old web developer, based in Manchester.

Howie is Technical Director at JP74 and specialises in PHP (Kohana) and Java (Spring) web applications, Search Engine Optimisation, custom CMS and web development.

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