• Home
  • Contact

Cross browser Rounded Corners using Liquid Canvas

By Sridhar Katakam · Comments (2) · Tuesday, April 27th, 2010

Update: I have replaced Liquid Canvas with jQuery Corner script. Even though the rounded corners are not as smooth (in IE), jQuery Corner script is lighter, easier to use and has more design choices.

Thanks to Nitin for his comment and letting me know about it.


Liquid Canvas is a JavaScript library which allows you to draw inside an HTML canvas element with an easy yet powerful description language.

Spent most of the day today playing around w/ Liquid Canvas on this blog. I have added rounded corners to individual posts on the front page, single post view and page view. Tested them in IE 6, IE 7, IE 8 and Firefox.

Screenshots:

rounded-corners-front-page
rounded-corners-single-view
rounded-corners-page

Here’s how I implemented it on this Builder powered WordPress blog:

Copy header.php from Builder directory into your child theme. Add the following before the closing php tag:

<!--Liquid Canvas code for cross browser rounded corners start-->
<!--[if IE]><script type="text/javascript" src="http://sridharkatakam.com/js/liquid-canvas/excanvas.js"></script><![endif]-->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://sridharkatakam.com/js/liquid-canvas/liquid-canvas.js"></script>
<script type="text/javascript" src="http://sridharkatakam.com/js/liquid-canvas/liquid-canvas-plugins.js"></script>

<script type="text/javascript">
  // First we wait until the document is completely loaded using the handy
  // jQuery "ready" method.
  $(window).load(function() {
	// Now we can paint our canvas.
	$(".post, .page").liquidCanvas(
		"fill{color:#FFFFFF} => roundedRect{radius:12}");
	$("#commentform textarea, #comments").liquidCanvas(
		"fill{color:#FFFFFF} => roundedRect{radius:12}");
  });
</script>
<!--Liquid Canvas code for cross browser rounded corners end-->

You might want to download Liquid Canvas, put the .js files on your server and accordingly change the paths in the above.

That’s it.

Be Sociable, Share!
  • Tweet

Related Posts

  • 6 May, 2010 -- Using jQuery Corner script (2)
Categories : Builder
Tags : Rounded corners
  • http://www.nitin09.wordpress.com Nitin

    This can be done using JQuery Corner Plugin also…

    Download : http://plugins.jquery.com/project/corners

    Demo : http://jquery.malsup.com/corner/

    Just we need include the downloaded the script.

    script : $(“#rounded_rect”).corner({‘radius’:’3px’});

    • Sridhar Katakam

      Hey Nitin,

      Thanks for replying.

      Is it the same script in both the links you provided. I downloaded from the 1st link and its version is 0.3 whereas the one in the 2nd link seems to be 2.09.

      Which is better?

Sridhar Katakam

My name is Sridhar Katakam. I work at iThemes as support moderator and my job involves helping people build awesome sites with WordPress and iThemes Builder in particular.

Recent Posts

  • 10,000 Posts in iThemes Builder Forum and counting…
  • Natural Vision Guides Niche Review Template Now Available in WordPress
  • Public Records Niche Review Template Now Available in WordPress Format
  • Tinnitus Remedies Review Template Now Available in WordPress Format
  • Personal Dental Care Site
  • Keyconfig in Firefox
  • Independence Day Celebration Photos
  • How To Display Just the Sticky Post on Front Page in WordPress
  • Builder Child Theme – White
  • Two Simple Sites in Builder
  • WordPress 3.0
  • Wonder La Trip
  • Skin Care Niche Review Template Now Available in WordPress Format
  • PreForeclosure Niche Review Template Now Available in WordPress Format
  • Arthritis Niche Review Template Now Available in WordPress Format

Twitter Updates

Recommended Resources

  • Digital Access Pass
  • DLGuard
  • HostGator
  • iThemes
  • StudioPress
Sridhar Katakam's Blog runs on Builder by iThemes
Copyright © 2012 All Rights Reserved