17
Feb

jQuery imageless buttons a la Google

   Posted by: Swizec   in Uncategorized

THE BUTTONS NOW WORK! Please go to jQuery imageless buttons a la Google take two.

NEXT DAY EDIT: I have been shown the error of my ways and in just how many browsers I never considered the buttons don’t work. I will fix this and do another announcement. Until then please move along, there is nothing to see here, but I’m leaving the whole shebang up for the world to see to remind me never again to be as cocky without making sure. Thanks guys, you’ve been a wonderful crowd.

For the record, the buttons used to work in firefox 3, but then it updated to 3.0.6 and they stopped working for some reason.

Last week the whole internet was abuzz with Google’s reinvention of the button. They’ve issued numerous press releases about it, or at least it was people who have worked on the project and talked about it on their blogs, whatever really. The buttons we see today on gmail and other google services are, from what I can tell, version 3.1 and are the result of “endless cycles of code revision and quality control” by a whole team of very talented engineers.

Well, dear Google engineers, I’ve got you beat. I’ve managed to recreate their results in roughly six hours over two days and although I haven’t tested all of this in Internet Explorer yet I have good faith that it works there as well as everywhere else (I’m basing this on the fact that lately my stuff works 95% on IE out of the box, practice I say).

Over these few hours I’ve created a simple to use jQuery plugin and am releasing it under GPL and MIT license so anyone can benefit from what I’ve come up with in a very simple way. In fact, all it takes is calling a function on an element, any element, and it the plugin injects a bunch of html and css into said element to turn it into a button. Furthermore, I’ve made it so that buttons can behave as dropdown menus of sorts, select elements or checkbox elements. They mimic these elements to such an extent their values submit together with forms and even an onchange event is fired when the value changes.

I’m afraid my blog won’t let me inject css styling and such so here’s a screenshot of what it looks like:

To see a live demo and download the code go to thejQuery imageless buttons page.

The hubris

I have been informed by many people that I am an idiot. And they’re right! What was I thinking putting trust in IE7 and not testing it there even once? My excuse is that I was far too excited about the whole thing, seriously, I’ve been walking on air all afternoon, and I don’t really have access to IE at home. So, Google guys, you’re still much awesomer than me! But I will prove that I can get this working on stupid browsers and still spend much less time on the whole thing.

While you’re all still happily commenting, if I get it working on FF2 and IE7 will that be alright? Or should I go as ancient as IE6 and FF1.5?

EDIT an hour or so later: Alright guys, it’s now PERFECT, absolutely perfect in Safari and even FF2 (at least on mac). Tomorrow I’ll tackle IE and once I surmount that insourmountable obstacle I shall spam dzone and such yet again in hopes of a more positive response. Hey, you did all say you loved the thing save for the whole browser issues. My role is to serve the users.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • StumbleUpon
  • TwitThis
  • DZone

Tags:

If you liked this post you should follow me on Twitter,
or see the music I like on last.fm,
or perhaps leave a comment, I like comments,
or go do your job because I know you're slacking,
or go write a blog of your own,
or tweet about something interesting,
or go out and have some fresh air,
or find a girlfriend,
or a boyfriend,
or a manbearpig,
or for fuck's sake stop reading this already,
no?
This entry was posted on Tuesday, February 17th, 2009 at 16:03 and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

17 comments so far

 1 

I was SO excited.

Then….IE fail… :(

February 17th, 2009 at 22:45
 2 

Nice… but it doesn’t work in IE.

February 17th, 2009 at 22:46
Mike
 3 

It also looks unbalanced on Safari and fails on Chrome.

Maybe you should have spent more time :-)

February 17th, 2009 at 23:08
 4 

95% success rate? Now 90%. And thanks very much, but I’d rather have 100% success rate. Maybe you should have spent the extra time to do QA like Google does.

Consider firing up a second browser before blasting other developers for taking a long time to develop something.

February 17th, 2009 at 23:16
Evernoob
 5 

Oh… poor you D:

I hope you can get it working in IE!

Had you rectified this before publishing you would probably have gotten a very positive response.

Better luck next time, bro.

February 17th, 2009 at 23:54
 6 

Works nicely in FF3, doesnt even load or fail gracefully in IE6.

As already said above, there is no point in having a go at other developers for taking a while to develop something when you have only done half the work (getting it to work in ALL the browsers is at least half the work in CSS / Javascript scripting, even when you use frameworks.)

February 18th, 2009 at 00:15
 7 

Holier-than-thou Fail

February 18th, 2009 at 00:19
Swizec
 8 

Oh well, just when you start having some faith in a browser it fails you again.

And I still think they took too long to develop this, because even if it takes me another 40 hours to get this thing working in IE7 it will still be a lot less time spent than what the google guys are saying they’ve spent.

Hubris, gotta love it!

February 18th, 2009 at 00:29
Evernoob
 9 

I think IE7+ would be fine. Based on my own server stats IE usage is certainly on the decline anyway.

People should not be using IE6. It has to die sooner or later.

February 18th, 2009 at 01:57
Evernoob
 10 

And also, don’t forget about Chrome too!

February 18th, 2009 at 02:01
 11 

On the Mac – seems to work great on FF3 — doesn’t work on Safari 2 at all. Definitely a nice job… would like too see some Safari support though.

February 18th, 2009 at 03:05
Broken
 12 

Contrary to the comment above, it’s broken on FF 3.0.6 on Mac (OS X 10.5.5).

February 18th, 2009 at 03:18
 13 

This sucks… does not work on my FF3 on my MAC

.. be less cocky
… spend more time testing

February 18th, 2009 at 06:00
 14 

Doesn’t work on FF3/Windows here either (the middle row of buttons are all overlayed on each other).

Shame, Google’s buttons rock!

February 18th, 2009 at 10:24
 15 

fails in both IE and FF on windows xp, sucks.

February 18th, 2009 at 10:42
 16 

How can you claim it works in 95% of browsers when it does not work in my FF3/Windows, IE6/Windows or Google Chrome/Windows.

OK Chrome is the closest to a decent render, but it still does not work…..

February 18th, 2009 at 10:51
Swizec
 17 

You know what sucks about the internet? Today my firefox updated to 3.0.6 and the buttons suddenly stopped working.

February 18th, 2009 at 11:23