Home > Web Front-end > JS Tutorial > body text

The picture automatically shrinks. Click to enlarge_Image special effects

WBOY
Release: 2016-05-16 19:03:07
Original
1243 people have browsed it

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template