Make image vertically centered align within a div and don’t let user save the picture easily

This is a very easy tutorial to set an image vertically centered within a div. Simple jQuery codes are used here. There is a also a nice option added that won’t let your user save the image easily. Please look at the code:


border:1px solid #000000;
margin:20px auto;

$(document).ready(function() {
$(‘.resize’).each(function() {
var src = $(this).find(‘img’).attr(‘src’);
$(this).find(‘img’).attr(‘src’, ‘t.png’).css({‘width’:’100%’, ‘height’:’100%’});
$(this).css({‘backgroundImage’: ‘url(‘+src+’)’});


Download Link

You may also read:  How to copy a list using list template in sharepoint?

You may also like...

Leave a Reply

%d bloggers like this: