惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Help Net Security
博客园 - Franky
GbyAI
GbyAI
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
爱范儿
爱范儿
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
aimingoo的专栏
aimingoo的专栏
博客园_首页
MongoDB | Blog
MongoDB | Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Recent Announcements
Recent Announcements
Scott Helme
Scott Helme
有赞技术团队
有赞技术团队
M
MIT News - Artificial intelligence
C
CERT Recently Published Vulnerability Notes
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Jina AI
Jina AI
F
Fortinet All Blogs
N
Netflix TechBlog - Medium
L
LangChain Blog
L
LINUX DO - 最新话题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
H
Hacker News: Front Page
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
AI
AI
T
Troy Hunt's Blog
Microsoft Azure Blog
Microsoft Azure Blog
阮一峰的网络日志
阮一峰的网络日志
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
罗磊的独立博客
S
Secure Thoughts
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
人人都是产品经理
人人都是产品经理
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
Apple Machine Learning Research
Apple Machine Learning Research
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
S
Security @ Cisco Blogs
Cloudbric
Cloudbric
E
Exploit-DB.com RSS Feed
Attack and Defense Labs
Attack and Defense Labs

博客园 - 刹那间我存在

一个可以放wordpress博客的PHP国外免费空间速度非常不错 重写alert,使用模态窗口强化alert。 - 刹那间我存在 - 博客园 利用 ASP.NET 的Timer 来实现的访问统计,感觉比较适合高访问量的网站 JavaScript 使用for(…in…)实现反射机制 给moz添加ie方法和属性,让firefox像IE一样编程 - 刹那间我存在 - 博客园 [原] 用 javascript 给你的博客增加运行代码功能 [原]ASP.NET 下生成的条形码。 同时支持三种事件模型 ASP调用.Net编写的动态库 - 刹那间我存在 - 博客园 整个表单元素禁用``` shtml精简教程 更改数据库所有者 BitComet超级优化设置 很酷的TOOLTip JS函数收藏 今天得到了两个 Google Analytics 的邀请 CustomValidator 控件 千万数量级分页存储过程(带效果演示) 推荐一下免费的1G网络硬盘,非常另类
网页中图片大小自动调整三种方法 - 刹那间我存在 - 博客园
刹那间我存在 · 2006-06-09 · via 博客园 - 刹那间我存在

1.鼠标滚动图片大小调整

<body>
<script LANGUAGE="JAVASCRIPT">
function bbimg(o){
   var zoom=parseInt(o.style.zoom, 10)||100;

zoom+=event.wheelDelta/12;

if (zoom>0)

 o.style.zoom=zoom+'%';

   return false;
}
</script> 
<img src="123.jpg" onload="javascript:if(this.width>screen.width-screen.width/2) this.style.width=screen.width-screen.width/2" onmousewheel="return bbimg(this)" > 
</body>

2.图片自动缩小到固定大小

<body onload="DrawImage(theimg)">
<script language="JavaScript">
<!--
//图片按比例缩放
var flag=false;
function DrawImage(ImgD){
  var image=new Image();
  var iwidth = 320;  //定义允许图片宽度
  var iheight = 180;  //定义允许图片高度
  image.src=ImgD.src;
  if(image.width>0 && image.height>0){
   flag=true;
   if(image.width/image.height>= iwidth/iheight){
    if(image.width>iwidth){  
    ImgD.width=iwidth;
    ImgD.height=(image.height*iwidth)/image.width;
    }else{
    ImgD.width=image.width;  
    ImgD.height=image.height;
    }
    ImgD.alt=image.width+"×"+image.height;
    }
   else{
    if(image.height>iheight){  
    ImgD.height=iheight;
    ImgD.width=(image.width*iheight)/image.height;     
    }else{
    ImgD.width=image.width;  
    ImgD.height=image.height;
    }
    ImgD.alt=image.width+"×"+image.height;
    }
   }

//-->
</script>
<img src="123.jpg" width="1024" height="768" name="theimg">
</body> 
3.滚轮图片缩放的代码<script language="javascript">
var count = 10;
function resizeimg(oImage)

count = Counting(count);
Resize(oImage,count);
return false;
}
function Counting(newzoom){ 
if (event.wheelDelta >= 120)
newzoom++;
else if (event.wheelDelta <= -120)
newzoom--;
if (newzoom<2) newzoom=2; ////只允许缩小到20%
if (newzoom>50) newzoom=50; ////只允许放大到500%
return newzoom; 
}
function Resize(oImage,newzoom){ 
oImage.style.zoom = newzoom + '0%'; 
count=newzoom;
}
</script>

然后在<img src="">中加入
onDblClick="return Resize(this,10);return false;" 
onmousewheel="return resizeimg(this)"