Home >Web Front-end >JS Tutorial >The picture automatically shrinks. Click to enlarge_Image special effects
If the web dialog box is not supported, open it in a new window
Purpose: Automatically reduce the picture Click to enlarge
Input: None
Return: None
function $(obj){
return document .getElementById(obj);
}
function ResizeImage(objImage,maxWidth) {
try{
if(maxWidth>0){
var objImg = $(objImage);
if(objImg.width()>maxWidth){
objImg.width(maxWidth).css("cursor","pointer").click(function(){
try{showModelessDialog(objImage.src); }catch(e){window.open(objImage.src);}
});
}
}
}catch(e){};
}