首页
导航
博客
电子书
算法
众创
代码
随贴
关于我们
您好,欢迎来到码863代码分享网! 请
[登录]
/
[注册]
搜 索
一句话概述代码的用途:
*
(例: 使用js控制复制及输入数据时只能是数字)
120
字
代码类型:
无
函数
类
插件
单段代码直接可运行
TAG标签:
(用空格隔开)
30
字
描述说明:
请填写代码的实现原理、应用场景、功能说明、调用示例、注意事项等。
代码正文:
*
请选择语言
html
python
javascript
php
sql
c
c++
c#
java
plain
简单说明:
排序:
测试一下
function limitImage(ImgD){ var areaWidth = 300; //你放置图片区域的宽度。 var areaHeight = 300; //你放置图片区域的高度。 var image=new Image(); image.src=ImgD.src; if(image.width>0 && image.height>0){ flag=true; if(image.width/image.height>= areaWidth/areaHeight){ if(image.width>areaWidth){ ImgD.width=areaWidth; ImgD.height=(image.height*areaWidth)/image.width; }else{ ImgD.width=image.width; ImgD.height=image.height; } ImgD.alt=image.width+"×"+image.height; }else{ if(image.height>areaHeight){ ImgD.height=areaHeight; ImgD.width=(image.width*areaHeight)/image.height; }else{ ImgD.width=image.width; ImgD.height=image.height; } ImgD.alt=image.width+"×"+image.height; } } }
CopyRight 2002~2023 精通2100网 联系邮箱:qqtxt@163.com
版权所有:精通2100网
湘ICP备2023018646号-1
MYSQl共执行 4 个查询,用时 0.002274751663208 秒,PHP脚本用时 0.004577 秒,占用内存 0.497 MB,Gzip 已启用