Unobtrusive Rounded Corners Box

by Acid.JS and WeMakeSites.NET

Are you planning to buy several components from Acid.JS? You can now compile your own Creative Web 2.0 Bundle and the more components you add to it, the more money you save. Start here.

RoundedCornersPanel.JS 4.0 / July 17, 2010

Experience the power of CSS with that cool widget!

Create rounded corners without additional images or sophisticated CSS and JavaScript coding. Rounded Corners Panel.JS does all this for you. You may choose between three types of rounded corner radius, you are allowed to specify dither color, so your rounded corners' edges do not look frayed. And more - you may tell which borders to round, and which not.

Component Demo

The most common way to round the corners of an element is on pageload. You may use the pageload() method to add elements for rounding on page load.

All Corners Rounded

Welcome to Rounded Corner Panel.JS

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Top Left Corner Not Rounded

Welcome to Rounded Corner Panel.JS

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Top Right Corner Not Rounded

Welcome to Rounded Corner Panel.JS

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Bottom Right Corner Not Rounded

Welcome to Rounded Corner Panel.JS

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Bottom Left Corner Not Rounded

Welcome to Rounded Corner Panel.JS

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

No Rounded Corners

Welcome to Rounded Corner Panel.JS

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Three Different Sizes of Rounded Corners

The size property of the methods of Rounded Corners Panel.JS allows to set three different size for the rounded corners of the panel that is manipulated - small, medium and large:

small

Welcome to Rounded Corner Panel.JS

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

medium

Welcome to Rounded Corner Panel.JS

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

large

Welcome to Rounded Corner Panel.JS

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Exclude Corners from Rounding

The roundedcorners property of the script are four Boolean properties. If set to "false", the selected corner will be excluded from rounding.

Specifying a Dither Color for the Rounded Corners

The dithercolor property allows the setting of a dithering color to the corners of the rendered panel so they looks smooth at the background color of their parent or the body of the page

Initialize on Page Load

The most common way to round the corners of an element is on pageload. You may use the pageload() to add elements for rounding on page load.

Welcome to Rounded Corner Panel.JS 3.0

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Initialize on Demand

The demand() method of Rounded Corners Panel.JS allows to round an element upon user action, for example on click:

click here to round the element below

Welcome to Rounded Corner Panel.JS 3.0

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Requirements

  • Standards-compliant (XHTML1.0, XHTML1.1, HTML5) or Skinny DTD public page

Troubleshooting

Older versions of Opera do not implement named color values of the method in JavaScript, so in order to make it work correctly, use hex color values for the background of the elements you style with rounded corners.

Supported Browsers

  • Internet Explorer 6
  • Internet Explorer 7
  • Internet Explorer 8
  • Internet Explorer 9 Ready
  • Mozilla FireFox
  • Opera
  • Google Chrome
  • Apple afari

Check what is trending now on Acid.JS