JQuery Corners-- What Will They Think Of Next?

I have consistently been impressed by the number and quality of JQuery plugins that abound. Today at work we ran across JQuery Corners. This friggin' awesome plugin allows you to put rounded corners on your divs and it's oh, so easy.

[More]

TweetBacks
Comments
Todd Rafferty's Gravatar Dude, you're behind. jQuery SQUARES is all the rage these days. ;)
# Posted By Todd Rafferty | 3/21/09 6:46 AM
Raymond Camden's Gravatar Nice!

Todd - is your comment a joke? Sorry - can't tell if you are being serious. It sounds like maybe you are saying there is another plugin that is better?
# Posted By Raymond Camden | 3/21/09 9:50 AM
Todd Rafferty's Gravatar @Ray: *chuckles* - I was joking. Note the ";)" at the end and uh, we can do squares already without jQuery.

The thing I like the most about jQuery corners is that it will attempt to work with IE. If your browser can't handle the radius css attribute, then it'll fall back to using images or it'll just go back to using squared edges. Of course, I could be getting my jquery corners plugin mixed up. There's at least 2 of them that I'm aware of.
# Posted By Todd Rafferty | 3/21/09 9:53 AM
Raymond Camden's Gravatar Nice. Thanks for the clarification. Sometimes there are so many jQuery plugins it can be a bit overwhelming. ;)
# Posted By Raymond Camden | 3/21/09 9:59 AM
James Moberg's Gravatar Check out NiftyCube for different options. One of their samples has a background image and there is a tabbed navigation sample:
http://www.html.it/articoli/niftycube/index.html

http://www.netzgesta.de/corner/
This one uses canvas and adds rounded corners to images. It's being updated to work with IE8 right now, but until then you can add this to make it work:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
# Posted By James Moberg | 3/21/09 10:24 AM
Brad Wood's Gravatar @Todd: Yeah, I only glanced through the JQuery.Corners code. It's real clean-- not nearly as much code as I would have expected for so many different designs it handles.
There's a case statement in there for each style that has wicked expressions like:
case 'round': return Math.round(width*(1-Math.cos(Math.asin(i/width))));

For my 30px rounded corners above, JQuery Corners created 30 transparent divs, all 1 px high, stacked on top of each other for both the top and bottom of my main div. It sets a white left and right border of however many pixels wide the corner is at that point. Basically, it appears to "erase" your div one line at a time by overlapping it with these "sliver" divs.

I never would have thought something like this would wok. lol

@James: Thanks for showing me NiftyCube and the "other" corner.js
# Posted By Brad Wood | 3/21/09 11:41 AM
Christine Panus's Gravatar We used this setup to create a nested grouping of divs that had a rounded border, with a rounded body content with a rounded header that had a half rounded accent line... (which is five nested rounded divs) we first used jquery.corners (http://www.atblabs.com/jquery.corners.html ) which was pretty slick, however we had some issues with the nesting not showing consistantly between browsers. Our borders would be thicker on top/bottom than left/right and would be different widths in the different browsers. the jquery.corner -- note the lack of an s (http://jquery.malsup.com/corner/) provided a more consistant result and seems to be more mature and updated more frequently.
# Posted By Christine Panus | 3/21/09 3:14 PM
Sean Corfield's Gravatar Safari warns me that site (malsup.com) "may contain malicious software / malware". That's the first site I've ever visited that has triggered that warning...

For years, I've been using NiftyCorners - nice to know there's a jQuery solution too (I feel like saying "of course" since there appears to be a jQuery solution for *everything*).
# Posted By Sean Corfield | 3/21/09 6:50 PM
Brad Wood's Gravatar @Sean: Perhaps Safari gets offended when you try to round its corners without asking. :)
# Posted By Brad Wood | 3/21/09 8:37 PM


BlogCFC was created by Raymond Camden. This blog is running version 5.9.5. Contact Blog Owner