Return to Snippet

Revision: 28691
at July 12, 2010 18:56 by simon87ainley


Initial Code
$( "div.rounded" ).each( function( i ) {
		$( this ).prepend( '<span class="rounded_top_left"></span>' );
		$( this ).prepend( '<span class="rounded_top_right"></span>' );
		$( this ).append( '<span class="rounded_bottom_left"></span>' );
		$( this ).append( '<span class="rounded_bottom_right"></span>' );
	});
	
	// Add rounded corners to the left corners
	$( "div.rounded_left" ).each( function( i ) {
		$( this ).prepend( '<span class="rounded_top_left"></span>' );
		$( this ).append( '<span class="rounded_bottom_left"></span>' );
	});
		
	// Add rounded corners to the right corners
	$( "div.rounded_right" ).each( function( i ) {
		$( this ).prepend( '<span class="rounded_top_right"></span>' );
		$( this ).append( '<span class="rounded_bottom_right"></span>' );
	});
	
	// Add rounded corners to the top corners
	$( "div.rounded_top" ).each( function( i ) {
		$( this ).prepend( '<span class="rounded_top_left"></span>' );
		$( this ).prepend( '<span class="rounded_top_right"></span>' );
	});
	
	// Add rounded corners to the bottom corners
	$( "div.rounded_bottom" ).each( function( i ) {
		$( this ).append( '<span class="rounded_bottom_left"></span>' );
		$( this ).append( '<span class="rounded_bottom_right"></span>' );
	});

Initial URL

                                

Initial Description
A light-weight solution for x-browser rounded corners solution, degrades gracefully back to square corners

Initial Title
jQuery rounded corners

Initial Tags
javascript, jquery

Initial Language
JavaScript