JavaScript scales images proportionally

高洛峰
Release: 2016-11-28 11:33:14
Original
1219 people have browsed it

js scales images in equal proportions. This function is very practical. When a web page loads a relatively large image, it often deforms the web page and makes the page ugly. So we thought of using JS to control the image beyond a certain range. pictures to stabilize the page layout. This code snippet completes this function, and the code is very concise and the effect is very good.

<html>  等比例缩放图片  
自动缩放后的效果
Copy after login


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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!