Anti-aliased Rounded corners with JQuery

Rounded CornersRecently I’ve been searching for a method of creating nice looking rounded corners with Javascript & JQuery.

First I found the “JQuery Corner” plugin for rounded corners, but was disappointed that it did not include smooth, anti-aliased corners.

I then did some more google-trawling and found this post, which contained a modified version of Curvy Corners for use with JQuery. Now this script was much much better.

However…the filesize was a massive 40kb, way too big for production use, and to make things worse the code was not compatible with packer so I could not reduce the filesize.

Well, I got busy, and fixed the errors. It is now fully packer friendly meaning easy rounded corners in JQuery at only 9kb 8kb 15kb 20kb 16kb 10kb. Excellent. Read more for the download link.

Demo and download

You can also grab the plugin from Google Code.

Download JQuery Curvy Corners Version 1.9

The packed version is only 10kb, the uncompressed version is 23kb (thats half the size of the original script!).

Quick example

To make a curvy cornered box simply use:

1
		$('.round_this').corner();

Thats all there is too it. A great script!

For more information on Curvy Corners, check out its official site.!

*Edit: Found a small error in IE7 with the backgroundPosition property, fixed now. New file uploaded.

*Edit 2 – 25th Sep 07: More optimizations, smaller file!

*Edit 3 – 29th Sep 07: More optimizations, smaller file, and demo page up!

*Edit 4 – 6th March 08: New version up with better background image support.

*Edit 5 – 19th May 08: No extra padding, safari fixed, larger filesize to reduce overhead and increase speed.

*Edit 6 – 9th Aug 08: General fixes from feedback

*Edit 7 – 7th Oct 08: Major overhaul to improve compatibility with other plugins

*Edit 8 – 2nd June 09: Now compatible with jquery 1.3.2 – All future updates will be on Google Code (http://code.google.com/p/jquerycurvycorners/) – Hence im closing comments here. Post your contributions either on google code or in the forum.

Found this post useful? Why not buy me a coffee!

Related Entries

Popular Entries

307 Responses to “Anti-aliased Rounded corners with JQuery”

RSS feed for comments on this post.

Pages: « 121 22 23 24 25 26 27 28 29 30 [31] Show All

  • 298 - Benjamin says: Reply to this comment

    Gravatar

    Tried extracting, but had trouble doing so. Seems that the scripts or other content in the .zip file relating to __MACOSX.

    Bottom line… ‘jquery.curvycorners.min’ is the only one that unpacked.

    Any suggestions? Different .zip/extraction program?

    @_@

    Comment made on April 24, 2009 at 10:25 pm

  • 299 - Craig says: Reply to this comment

    Gravatar

    Thanks for the plugin!
    Saves me heaps of time on a regular basis!

    And thanks to Smccullough for the bug fix, no more uncaught exceptions for me!

    Comment made on April 27, 2009 at 1:43 am

  • 300 - Jan says: Reply to this comment

    Gravatar

    @Smccullough: This fixed when you have all corners rounded, but I still got it when i do this:

    $('#header').corner( {
    tl: false,
    tr: false,
    bl: { radius: 8 },
    br: { radius: 8 } });

    Even if i try radius 0 it doesn’t work

    Comment made on May 5, 2009 at 11:34 am

  • 301 - Smccullough says: Reply to this comment

    Gravatar

    @Jan

    I couldn’t seem to replica your issue you are having?
    I copied and pasted verbatim with no errors:

    $(document).ready(function()
    {
    /* Round corner */

    $('div.rounded').corner( {
    tl: false,
    tr: false,
    bl: { radius: 8 },
    br: { radius: 8 }
    });
    });

    What exactly is your setup?
    Browser: IE6/IE7 (/IE8, I haven’t test 8 yet)?
    jQuery version?
    In what order are you adding your script includes?

    You can post a response here or over at my blog (I’ll be able to response to you quicker if it’s on mine, simple because I’ll get an email notice)

    Hope I can help! :)

    Your friendly neighbourhood,
    Smccullough

    Comment made on May 6, 2009 at 2:26 pm

  • 302 - Tony says: Reply to this comment

    Gravatar

    These things aren’t working on IE8.

    Comment made on May 16, 2009 at 3:56 pm

  • 303 - Leanne says: Reply to this comment

    Gravatar

    Hi there, I was wondering if there’ll be an ie8 fix coming out soon? I am starting to reeeeally hate ie8.. :X

    Comment made on May 26, 2009 at 11:49 am

  • 304 - Leanne says: Reply to this comment

    Gravatar

    Oh and in IE8, this is the error (if it helps?):

    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SU 3.22; SLCC1; .NET CLR 2.0.50727; InfoPath.2; Media Center PC 5.0; OfficeLiveConnector.1.3; OfficeLivePatch.0.0; .NET CLR 3.5.30729; .NET CLR 3.0.30618)
    Timestamp: Tue, 26 May 2009 10:50:34 UTC

    Message: Exception thrown and not caught
    Line: 73
    Char: 2424
    Code: 0
    URI: http://www.*****************.com/scripts/jquery-1.3.2.min.js

    Comment made on May 26, 2009 at 11:51 am

  • 305 - Leanne says: Reply to this comment

    Gravatar

    Also, is there a drop shadow / outer glow plugin which would work with the rounded corners? :)

    Comment made on May 26, 2009 at 1:29 pm

  • 306 - All my bookmarks ever | Daniel John Gayle says: Reply to this comment

    Gravatar

    [...] Blue Anvil Journal » Blog Archive » Anti-aliased Rounded corners with JQuery [...]

    Pingback made on May 30, 2009 at 12:51 am

  • 307 - Mike Jolley says: Reply to this comment

    Gravatar

    Those looking for compatibility with new jQuery should now check out http://code.google.com/p/jquerycurvycorners/ – Ive moved the code there and updated the build.

    Comment made on June 2, 2009 at 12:52 pm

Pages: « 121 22 23 24 25 26 27 28 29 30 [31] Show All

About this site

Blue Anvil is the online web design journal & portfolio of , a web designer from Norfolk, England. Read More »
ThemeSlice
  • Featured work - More

    • Beefjack
    • Integrity
    • theotaku.com
    • Manic Melon
  • Latest Tweet - More

    • Dropped yoghurt all down my pyjamas. Bugger. Working in my boxers. Ill get dressed some time. Soon.
  • Out of the blue - More

    • Wordpress 2.8 Memory Usage

      With the release of wordpress 2.8 some people are experiencing out of memory php errors along the lines of:

      Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 228968 bytes)

      You may also be seeing pages fail to load fully (for example the wordpress admin dashboard) if php error messages are hidden. I’ve already had one case where we thought certain plugins were to blame but in fact it was just out of memory. A possible fix (which worked in the previously mentioned case) is to add:

      @ini_set('memory_limit','64M');

      to your wp-config file. Has anyone else encoutered this error?

    • jQuery Curvy Corners 1.x and 2.x updated and moved to Google Code

      I have updated the jQuery Curvy Corners plugins (both versions) with jQuery 1.3.2 support and other enhancements. The beta 2 version is looking good and is working in all version of IE, Opera, and Firefox (as far as I can tell).

      You can grab the latest files from Google Code here. Enjoy.

    • I’m too nice: Wordpress Download Monitor plugin page add-on now included with Download Monitor version 3.1.

      It was going to be a paid add-on, but today I had a change of heart and bundled it with the newest version of download monitor. The add-on lets you make a download page using a shortcode; it lists your downloads/categories with full sorting, pagination, and search functionality. Not bad eh? See the documentation topic to see full instructions for usage, or see my download page to see it in action.

      And if you use it, please consider making a donation to ensure the continued development of the plugin!

    • 2 Announcements: New Support forum, and feedback wanted for new download page add-on

      First, I’ve implemented a support forum to Blue Anvil mainly for plugin support and ideas which can be found here. Hopefully this will make supporting my plugins easier. Feel free to add to the discussions (there is also a general web design forum too).

      Secondly, I’ve added a demo of the new download page add-on I’m making for Download Monitor. This will be a paid add-on and it would be cool to get any feedback or suggestions from anyone who would like such a feature. My download page is here. Please leave feedback on the forum or in the comments.