Return to Snippet

Revision: 33813
at December 13, 2010 21:03 by gerhardsletten


Updated Code
jQuery(document).ready(function () {
	$('.fx-img').each(function(){
		var me = $(this);
		var img = $('img',me);
		me.css('background', 'url('+img.attr('src')+') no-repeat');
		me.css('display', 'block');
if(img.height() && img.width()) {
		me.height(img.height());
		me.width(img.width());
}
		img.hide();
	});
});

Revision: 33812
at October 13, 2010 20:22 by gerhardsletten


Initial Code
jQuery(document).ready(function () {
	$('.fx-img').each(function(){
		var me = $(this);
		var img = $('img',me);
		me.css('background', 'url('+img.attr('src')+') no-repeat');
		me.css('display', 'block');
		me.height(img.height());
		me.width(img.width());
		img.hide();
	});
});

Initial URL

                                

Initial Description
You can't add rounded corners on images with css, but this is a fix. 

Markup:
<span>
	<img>
</span>

CSS:
.rounded {border-radius: 8px;}

Initial Title
Rounded corners on images with jquery

Initial Tags

                                

Initial Language
jQuery