curveMe - cross-browser curvy corners
Overview
This plugin offers cross-browser curvy corners, alleviating the need to employ multiple techniques to achieve this effect across different browsers. It uses PHP GD to draw the actual curves, so make that's enabled on your server (it normally is by default). Using PHP to draw the corners rather than, say, JavaScript (such as with the jQuery curve() plugin) means no need to flood the DOM with little elements that make up each curve.
Example
Here's the code behind this example:
Usage
Important: In curveMe.js, be sure to update the path to curveMe.php relevant to your server.
The plugin will run on any elements it finds with a particular class format, namely:
class='curveMe tl,tr,bl,br-border-#colour'
tl, tr, bl and br represent the radius for each corner. These do not all have to be equal. The fifth part is optional and represents the border thickness.
See demo above for a working example.
It can also be run on elements inserted post-load by calling the global function curveMe() (these elements must still have the above class structure). The final param is the border colour to use (if omitted, the background colour of the element will be used instead).
Notes
Google Chrome
Some versions of Google Chrome can't read computed (as opposed to implicitely set) background colours, so ensure the parent element of any element that you run this plugin on has a stipulated background colour. Otherwise, if it's default white, Chrome reads the background as rgba(0, 0, 0).
Comments (4)
utah mortgage, at 23/11/'10 17:49, said:
Mitya, at 23/11/'10 18:09, said:
Tommy, at 9/06/'11 23:29, said:
Mitya, at 1/02/'12 22:51, said: