Home >Web Front-end >JS Tutorial >The picture automatically shrinks. Click to enlarge_Image special effects

The picture automatically shrinks. Click to enlarge_Image special effects

WBOY
WBOYOriginal
2016-05-16 19:03:071268browse

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){};
}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn