Home > CMS Tutorial > DEDECMS > How to use js to control the size of pictures in the DreamWeaver article page

How to use js to control the size of pictures in the DreamWeaver article page

藏色散人
Release: 2020-01-04 09:38:38
Original
2364 people have browsed it

How to use js to control the size of pictures in the DreamWeaver article page

织梦文章页中怎么用js控制图片的大小?

织梦DEDECMS文章页中用js控制图片的大小

推荐学习:织梦cms

一般不建议使用expression,因为expression对浏览器资源要求比较 高。之前在做一个图集风格的时候在网上看到了一些用js控制图片的例子,我就分享一下给大家!

<script language="javascript">  
     function checkImg(mypic){  
     var xw=720;  
     var width = bigimg.width;  
     if (width > xw ) bigimg.width = xw;  
}  
</script>  
 
<img  id="bigimg" onload="checkImg(this)" src=&#39;/uploads/allimg/100701/co100F1194604-0.jpg&#39;  width=&#39;1023&#39;  alt=&#39;&#39; />
Copy after login

The above is the detailed content of How to use js to control the size of pictures in the DreamWeaver article page. For more information, please follow other related articles on the PHP Chinese website!

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