<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>张振峰 &#187; 图片大小</title>
	<atom:link href="http://www.zhangzhenfeng.com/tags/%e5%9b%be%e7%89%87%e5%a4%a7%e5%b0%8f/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zhangzhenfeng.com</link>
	<description>阵风：天生我材必有用</description>
	<lastBuildDate>Wed, 14 Sep 2011 09:51:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>用JS控制页面图的图片大小的通用代码</title>
		<link>http://www.zhangzhenfeng.com/resizeimages/</link>
		<comments>http://www.zhangzhenfeng.com/resizeimages/#comments</comments>
		<pubDate>Sun, 17 Feb 2008 12:22:24 +0000</pubDate>
		<dc:creator>阵风</dc:creator>
				<category><![CDATA[网站]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[图片大小]]></category>

		<guid isPermaLink="false">http://www.zhangzhenfeng.com/?p=82</guid>
		<description><![CDATA[这个用JS控制页面图片大小的方法非常好，无须在显示图片时添加额外的代码。这个一般用于文章查看的页面,针对新闻性质的网站,此外这个算法是直接分析网页中所有图片的,因此如果你的版面设计中有比指定宽度大的图片是不能用这个函数的(或者用id区分开)。]]></description>
			<content:encoded><![CDATA[<p>这个用JS控制页面图片大小的方法非常好，<strong>无须在显示图片时添加额外的代码</strong>。</p>
<p>这个一般用于文章查看的页面,针对新闻性质的网站,此外这个算法是直接分析网页中所有图片的,因此如果你的版面设计中有比指定宽度大的图片是不能用这个函数的(或者用id区分开)。<span id="more-82"></span></p>
<blockquote><p><code>&lt;script language=&quot;javascript&quot;&gt;<br />function ResizeImages()<br />{<br />&nbsp;&nbsp; var myimg,oldwidth;<br />&nbsp;&nbsp; var maxwidth=600;<br />&nbsp;&nbsp; for(i=0;i&lt;document.images.length;i++){<br />&nbsp;&nbsp;&nbsp;&nbsp; myimg = document.images&#91;i&#93;;<br />&nbsp;&nbsp;&nbsp;&nbsp; if(myimg.width &gt; maxwidth)<br />&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oldwidth = myimg.width;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myimg.width = maxwidth;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myimg.height = myimg.height * (maxwidth/oldwidth);<br />&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp; }<br />}<br />ResizeImages();<br />&lt;/script&gt;</code></p></blockquote>
<p>转自 IT柏拉图的博客：<a href="http://prato.bokele.com/">http://prato.bokele.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.zhangzhenfeng.com/resizeimages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

