jQuery Canvas Rounded Corners

Written by Thomas

Topics: Graphics, Scripting

site: http://ragamo.medioclick.com/jquery/corners/
tutorial: http://developer.mozilla.org/en/Canvas_tutorial

This simple jQuery Plug-in is smart solution for you to make rounded corners. Fully tested in Internet Explorer 7 and Firefox 3, jQuery Canvas Rounded Corners v 1.1 works on your DOM objects using “canvas” element. If you are new to what “canvas” element is, you can read Canvas tutorial at Mozilla Developer Center.

You’ll need to attach three component of Javascript files for installment. A variant of excanvas.js (newExcanvas.js) must be included to create canvas elements in IE. Here they are:
script type=”text/javascript” src=”jquery-lastest.js
script type=”text/javascript” src=”jquery.corners.js
script type=”text/javascript” src=”newExcanvas.js

To start creating round corner just add:
$(selector).corners([options]);

List of options :
radio: (int) radius size of corners
inColor: (color) inside color of element
outColor: (color) outside color of corners
borderSize: (int) border width
borderColor: (color) color of borders

You can learn more about this simple script from some examples given and download the jQuery Canvas Rounded Corners files at the source page. Should be easy as 1 2 3 ;)

1 Comment Comments For This Post I'd Love to Hear Yours!

  1. This is an easy way to create rounded corners. If yo want more control and possibilities, you can give the jQuery background canvas plugin a try:

    jQuery Background Canvas Plugin

Leave a Comment Here's Your Chance to Be Heard!