Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- image.style.width = '50%'
- image.style.height = 'auto'
- if($(this).width() > $(this).height()) {
- $(this).css('width',MaxPreviewDimension+'px');
- $(this).css('height','auto');
- } else {
- $(this).css('height',MaxPreviewDimension+'px');
- $(this).css('width','auto');
- }
- myimg = document.getElementById('myimg');
- myimg.style.height = "50px";
- myimg.style.width = "50px";
- myimg = document.getElementById('myimg');
- myimg.height = myimg.height * 2;
- myimg.width = myimg.width * 2;
- function Resize(imgId)
- {
- var img = document.getElementById(imgId);
- var w = img.width, h = img.height;
- w /= 2; h /= 2;
- img.width = w; img.height = h;
- }
- function resize_image(image, w, h) {
- if (typeof(image) != 'object') image = document.getElementById(image);
- if (w == null || w == undefined)
- w = (h / image.clientHeight) * image.clientWidth;
- if (h == null || h == undefined)
- h = (w / image.clientWidth) * image.clientHeight;
- image.style['height'] = h + 'px';
- image.style['width'] = w + 'px';
- return;
- }
- var scale=0.5;
- minWidth=50;
- minHeight=100;
- if($("#id img").width()*scale>minWidth && $("#id img").height()*scale >minHeight)
- {
- $("#id img").width($("#id img").width()*scale);
- $("#id img").height($("#id img").height()*scale);
- }
Add Comment
Please, Sign In to add comment