Tillfredsställelse för slutanvändaren är en viktig del i mitt intresse, och med
mina goda kunskaper inom både front- och backend programmering ger jag
allt jag har för att dra mitt strå i stacken till en bättre webb för oss alla.

Toggle ninesixty theme (960) grids with js

Postad: 28 januari, 2010 av Emil Stjerneman

Taggar: Drupal,   JavaScript,   ninesixty

Toggle  ninesixty theme (960) grids with jsI love the "show-grid" body class, but sometimes you don't want to see the pretty grids when you developing.

As it is right now, you have to edit your subtheme bodytag as in remove or rename the "show-grid" class to disable the grids, then add it or rename is to show-grid again.

I was tired of doing that every time I wanted to see how the site really looked without the grids, so I made a little JS-Snippet.

Include the js-file in your subtheme and press "shift + g" to toggle.

To include this, edit your .info theme file and paste this

; The grid toggle javascript
scripts[] = gridtoggle.js

If you are in a <textarea> or an <input> the script will not toggle (It will think you are typing as usually).

It's tested on my Windows XP machine with

  • IE8
  • IE7 (compability mode in IE8)
  • FF 3.6
  • Chrome 4.0.249.78
  • Safari 4.0.3

I have no good idea how to integrate this in a smart way if the ninesixty maintainers decide to include this in future releases.

Demo

Press shift+g on this page.

Bookmarklet

If you dont want to inlcude the JS-file, you can also user this bookmarklet. Simply click and drag the bookmarklet image to your bookmark field in your browser. Then all you have to do is to click on the bookmarket and the grid will toggle on and off.

BilagaStorlek
gridtoggle.js.txt635 byte

Kommentarer

Skriv kommentar
Gästs bild
Chris Free
29 januari, 2010 - 01:15

awesome idea - I just started working with ninesixty and this was pissing me off.

#1
Gästs bild
Bobby
29 januari, 2010 - 11:25

Nice

#2
Emils bild
Emil
29 januari, 2010 - 23:51

Thanks Chris and Bobby.

#3

Skriv ny kommentar