Ever wanted rounded corners on all images in your post? With CSS3 and a little bit of jQuery, its now possible.
Here’s the code snippet:
$(document).ready(function(){
$('img').each(function(){
$(this).load(function(){
$(this)
.css('display', 'block')
.css('width', $(this).width())
.css('height', $(this).height())
.css('background', 'url('+$(this).attr('src')+') no-repeat')
.css('-webkit-border-radius', '10px')
.css('-moz-border-radius', '10px')
.css('border-radius', '10px')
.attr('src', '')
.attr('alt', '');
});
});
});
View it here.
No comments
No comments yet...