<?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>UECSS.COM &#187; 自适应</title>
	<atom:link href="http://uecss.com/tag/%e8%87%aa%e9%80%82%e5%ba%94/feed" rel="self" type="application/rss+xml" />
	<link>http://uecss.com</link>
	<description>记录我们自己的前端生活!</description>
	<lastBuildDate>Sun, 29 Aug 2010 13:27:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>图片自适应屏幕分辨率大小</title>
		<link>http://uecss.com/image-adaptive-screen-resolution-size-of-the-2.html</link>
		<comments>http://uecss.com/image-adaptive-screen-resolution-size-of-the-2.html#comments</comments>
		<pubDate>Mon, 25 Jan 2010 09:14:16 +0000</pubDate>
		<dc:creator>ailin0807</dc:creator>
				<category><![CDATA[自适应]]></category>

		<guid isPermaLink="false">http://uecss.com/?p=100</guid>
		<description><![CDATA[我们在切图的时候常会遇到这样一个问题：Design of the head常是一个通栏很漂亮的一个图片，它的宽度超过了1024的屏幕分辨率，虽然我们现在用的到的都是大于1024的分辨率，但也不排除用1024或是比1024更小的分辨率。那这个时候这个非常漂亮的图片怎么办呢这个时候我们就可以使用图片随着分辨率的大小自动调整的方法来解决这个问题： 这里我们需要用到一个JS文件,点击下载这个JS: http://cid-8127d59343265667.skydrive.live.com/self.aspx/NamipanPublic/2010-01-25/jquery.js 还有必须前面申明 : &#60;!--CTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34;&#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1transitional.dt--&#62;&#38;lt;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34;&#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1transitional.dtd&#34;&#38;gt; &#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34; &#62; &#60;/html&#62; 不然在ie下面就是没用的 。这些都准备好之后，在img的下面加上这样一段代码： &#60;script type=&#8221;text/javascript&#8221;&#62; $(&#8220;#banner&#8221;).width(document.documentElement.clientWidth); &#60;/script&#62; 在图片上引用ID: img src="" id="banner" alt="" 注：这个ID要一至，不然会没有效果。 这时我们会看到图片会自适应分辨率的大小图片会被自动缩放，但是可能会和Design有一些出入。我们可以采用第二种方法： 图片的变化只限于分辨率小于1300或是1024的情况下变化，那么我们的那段代码就要这样去写: &#60;script type=&#34;text/javascript&#34;&#62; if(window.screen.width &#60;= 1024) { $(&#34;#banner&#34;).width(document.documentElement.clientWidth); } &#60;/script&#62; 这样我们就只会看到当分辨率小于1024的时候才会看到图片自动缩放了。]]></description>
			<content:encoded><![CDATA[<p>我们在切图的时候常会遇到这样一个问题：Design of the head常是一个通栏很漂亮的一个图片，它的宽度超过了1024的屏幕分辨率，虽然我们现在用的到的都是大于1024的分辨率，但也不排除用1024或是比1024更小的分辨率。那这个时候这个非常漂亮的图片怎么办呢这个时候我们就可以使用图片随着分辨率的大小自动调整的方法来解决这个问题：</p>
<p>这里我们需要用到一个JS文件,点击下载这个JS:</p>
<p><a href="http://cid-8127d59343265667.skydrive.live.com/self.aspx/NamipanPublic/2010-01-25/jquery.js">http://cid-8127d59343265667.skydrive.live.com/self.aspx/NamipanPublic/2010-01-25/jquery.js</a></p>
<p>还有必须前面申明 :<span id="more-100"></span></p>
<pre>&lt;!--CTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1transitional.dt--&gt;&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1transitional.dtd&quot;&amp;gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &gt; &lt;/html&gt;</pre>
<p>不然在ie下面就是没用的 。这些都准备好之后，在img的下面加上这样一段代码：</p>
<blockquote><p>
&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
$(&#8220;#banner&#8221;).width(document.documentElement.clientWidth);<br />
&lt;/script&gt;
</p></blockquote>
<p>在图片上引用ID:</p>
<pre>img src="" id="banner" alt="" 注：这个ID要一至，不然会没有效果。</pre>
<p>这时我们会看到图片会自适应分辨率的大小图片会被自动缩放，但是可能会和Design有一些出入。我们可以采用第二种方法： 图片的变化只限于分辨率小于1300或是1024的情况下变化，那么我们的那段代码就要这样去写:</p>
<blockquote><p>&lt;script type=&quot;text/javascript&quot;&gt;<br />
if(window.screen.width &lt;= 1024) { $(&quot;#banner&quot;).width(document.documentElement.clientWidth); }<br />
&lt;/script&gt;
</p></blockquote>
<p>这样我们就只会看到当分辨率小于1024的时候才会看到图片自动缩放了。</p>
]]></content:encoded>
			<wfw:commentRss>http://uecss.com/image-adaptive-screen-resolution-size-of-the-2.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
