{"id":279,"date":"2012-09-03T11:11:00","date_gmt":"2012-09-03T03:11:00","guid":{"rendered":"http:\/\/gaigaiming.com\/?p=279"},"modified":"2012-09-03T11:11:00","modified_gmt":"2012-09-03T03:11:00","slug":"%e4%b8%8d%e5%90%8c%e6%b5%8f%e8%a7%88%e5%99%a8%e4%b8%8d%e5%90%8c%e5%b1%8f%e5%b9%95%e5%88%86%e8%be%a8%e7%8e%87%e8%87%aa%e5%8a%a8%e8%b0%83%e7%94%a8%e4%b8%8d%e5%90%8ccss%e7%9a%84javascript%e4%bb%a3","status":"publish","type":"post","link":"https:\/\/www.gaigaiming.com\/index.php\/2012\/09\/03\/%e4%b8%8d%e5%90%8c%e6%b5%8f%e8%a7%88%e5%99%a8%e4%b8%8d%e5%90%8c%e5%b1%8f%e5%b9%95%e5%88%86%e8%be%a8%e7%8e%87%e8%87%aa%e5%8a%a8%e8%b0%83%e7%94%a8%e4%b8%8d%e5%90%8ccss%e7%9a%84javascript%e4%bb%a3\/","title":{"rendered":"\u4e0d\u540c\u6d4f\u89c8\u5668\u4e0d\u540c\u5c4f\u5e55\u5206\u8fa8\u7387\u81ea\u52a8\u8c03\u7528\u4e0d\u540cCSS\u7684JavaScript\u4ee3\u7801"},"content":{"rendered":"<div>\n<p>\u4e0d\u540c\u6d4f\u89c8\u5668\u4e0d\u540c\u5c4f\u5e55\u5206\u8fa8\u7387\u81ea\u52a8\u8c03\u7528\u4e0d\u540cCSS\u7684\u4ee3\u7801\u3002\u65e2\u5224\u65ad\u6d4f\u89c8\u5668\uff0c\u4e5f\u5224\u65ad\u5206\u8fa8\u7387\u3002<\/p>\n<p>\u3010\u8f6c\u3011http:\/\/www.smalluv.com\/use_javascript_to_automatically_deployment_css.html<\/p>\n<p>&lt;SCRIPT&nbsp;LANGUAGE=&quot;JavaScript&quot;&gt;<br \/>&nbsp;&lt;!&#8211;<br \/>&nbsp;if&nbsp;(window.navigator.userAgent.indexOf(&quot;MSIE&quot;)&gt;=1)<br \/>&nbsp;{<br \/>&nbsp;var&nbsp;IE1024=&quot;&quot;;<br \/>&nbsp;var&nbsp;IE800=&quot;&quot;;<br \/>&nbsp;var&nbsp;IE1152=&quot;&quot;;<br \/>&nbsp;var&nbsp;IEother=&quot;&quot;;<\/p>\n<p>ScreenWidth(IE1024,IE800,IE1152,IEother)<br \/>&nbsp;}else{<br \/>&nbsp;if&nbsp;(window.navigator.userAgent.indexOf(&quot;Firefox&quot;)&gt;=1)<br \/>&nbsp;{<br \/>&nbsp;\/\/\u5982\u679c\u6d4f\u89c8\u5668\u4e3aFirefox<br \/>&nbsp;var&nbsp;Firefox1024=&quot;&quot;;<br \/>&nbsp;var&nbsp;Firefox800=&quot;&quot;;<br \/>&nbsp;var&nbsp;Firefox1152=&quot;&quot;;<br \/>&nbsp;var&nbsp;Firefoxother=&quot;&quot;;<\/p>\n<p>ScreenWidth(Firefox1024,Firefox800,Firefox1152,Firefoxother)<br \/>&nbsp;}else{<br \/>&nbsp;\/\/\u5982\u679c\u6d4f\u89c8\u5668\u4e3a\u5176\u4ed6<br \/>&nbsp;var&nbsp;Other1024=&quot;&quot;;<br \/>&nbsp;var&nbsp;Other800=&quot;&quot;;<br \/>&nbsp;var&nbsp;Other1152=&quot;&quot;;<br \/>&nbsp;var&nbsp;Otherother=&quot;&quot;;<br \/>&nbsp;ScreenWidth(Other1024,Other800,Other1152,Otherother)<br \/>&nbsp;}<br \/>&nbsp;}<\/p>\n<p>function&nbsp;ScreenWidth(CSS1,CSS2,CSS3,CSS4){<br \/>&nbsp;if&nbsp;((screen.width&nbsp;==&nbsp;1024)&nbsp;&amp;&amp;&nbsp;(screen.height&nbsp;==&nbsp;768)){<br \/>&nbsp;setActiveStyleSheet(CSS1);<br \/>&nbsp;}else{<br \/>&nbsp;if&nbsp;((screen.width&nbsp;==&nbsp;800)&nbsp;&amp;&amp;&nbsp;(screen.height&nbsp;==&nbsp;600)){<br \/>&nbsp;setActiveStyleSheet(CSS2);<br \/>&nbsp;}else{<br \/>&nbsp;if&nbsp;((screen.width&nbsp;==&nbsp;1152)&nbsp;&amp;&amp;&nbsp;(screen.height&nbsp;==&nbsp;864)){<br \/>&nbsp;setActiveStyleSheet(CSS3);<br \/>&nbsp;}else{<br \/>&nbsp;setActiveStyleSheet(CSS4);<br \/>&nbsp;}}}<br \/>&nbsp;}<\/p>\n<p>function&nbsp;setActiveStyleSheet(title){<br \/>&nbsp;document.getElementsByTagName(&quot;link&quot;)[0].href=&quot;style\/&quot;+title;<br \/>&nbsp;}<br \/>&nbsp;\/\/&#8211;&gt;<br \/>&nbsp;&lt;\/SCRIPT&gt;<\/p>\n<p>\u89e3\u91ca\uff1a<br \/>&nbsp;var&nbsp;IE1024=&quot;&quot;;<br \/>&nbsp;var&nbsp;IE800=&quot;&quot;;<br \/>&nbsp;var&nbsp;IE1152=&quot;&quot;;<br \/>&nbsp;var&nbsp;IEother=&quot;&quot;;<\/p>\n<p>\u5f15\u53f7\u91cc\u9762\u5206\u522b\u586b\u5199\uff0c\u7528\u6237\u4f7f\u7528IE\u7684\u65f6\u5019\u5e76\u4e14\u5206\u8fa8\u7387\u4e3a1024*768,800*600,1152*864\u8981\u4f7f\u7528\u7684css\u6587\u4ef6\u540d.<\/p>\n<p>var&nbsp;Firefox1024=&quot;&quot;;<br \/>&nbsp;var&nbsp;Firefox800=&quot;&quot;;<br \/>&nbsp;var&nbsp;Firefox1152=&quot;&quot;;<br \/>&nbsp;var&nbsp;Firefoxother=&quot;&quot;;<\/p>\n<p>\u5f15\u53f7\u91cc\u9762\u5206\u522b\u586b\u5199\uff0c\u7528\u6237\u4f7f\u7528FF\u7684\u65f6\u5019\u5e76\u4e14\u5206\u8fa8\u7387\u4e3a1024*768,800*600,1152*864\u8981\u4f7f\u7528\u7684css\u6587\u4ef6\u540d.<\/p>\n<p>var&nbsp;Other1024=&quot;&quot;;<br \/>&nbsp;var&nbsp;Other800=&quot;&quot;;<br \/>&nbsp;var&nbsp;Other1152=&quot;&quot;;<br \/>&nbsp;var&nbsp;Otherother=&quot;&quot;;<\/p>\n<p>&nbsp;<\/p>\n<p>\u5f15\u53f7\u91cc\u9762\u5206\u522b\u586b\u5199\uff0c\u7528\u6237\u4f7f\u7528\u5176\u4ed6\u6d4f\u89c8\u5668\u7684\u65f6\u5019\u5e76\u4e14\u5206\u8fa8\u7387\u4e3a1024*768,800*600,1152*864\u8981\u4f7f\u7528\u7684css\u6587\u4ef6\u540d.<\/p>\n<p>&nbsp;<\/p>\n<p>\u4e0d\u5224\u65ad\u5206\u8fa8\u7387\uff0c\u53ea\u5224\u65ad\u6d4f\u89c8\u5668<br \/>&nbsp;\u7a0b\u5e8f\u4ee3\u7801<\/p>\n<p>&lt;SCRIPT&nbsp;LANGUAGE=&quot;JavaScript&quot;&gt;<br \/>&nbsp;&lt;!&#8211;<br \/>&nbsp;if&nbsp;(window.navigator.userAgent.indexOf(&quot;MSIE&quot;)&gt;=1)<br \/>&nbsp;{<br \/>&nbsp;\/\/\u5982\u679c\u6d4f\u89c8\u5668\u4e3aIE<br \/>&nbsp;setActiveStyleSheet(&quot;default.css&quot;);<br \/>&nbsp;}else{<br \/>&nbsp;if&nbsp;(window.navigator.userAgent.indexOf(&quot;Firefox&quot;)&gt;=1)<br \/>&nbsp;{<br \/>&nbsp;\/\/\u5982\u679c\u6d4f\u89c8\u5668\u4e3aFirefox<br \/>&nbsp;setActiveStyleSheet(&quot;default2.css&quot;);<br \/>&nbsp;}else{<br \/>&nbsp;\/\/\u5982\u679c\u6d4f\u89c8\u5668\u4e3a\u5176\u4ed6<br \/>&nbsp;setActiveStyleSheet(&quot;newsky.css&quot;);<br \/>&nbsp;}<br \/>&nbsp;}<\/p>\n<p>function&nbsp;setActiveStyleSheet(title){<br \/>&nbsp;document.getElementsByTagName(&quot;link&quot;)[0].href=&quot;style\/&quot;+title;<br \/>&nbsp;}<br \/>&nbsp;\/\/&#8211;&gt;<br \/>&nbsp;&lt;\/SCRIPT&gt;<\/p>\n<p>\u89e3\u91ca\uff1a<br \/>&nbsp;\u5982\u679c\u6d4f\u89c8\u5668\u4e3aIE\uff0c\u5219\u8c03\u7528default.css<br \/>&nbsp;\u5982\u679c\u6d4f\u89c8\u5668\u4e3aFirefox\uff0c\u5219\u8c03\u7528default2.css<br \/>&nbsp;\u5982\u679c\u6d4f\u89c8\u5668\u4e3a\u5176\u4ed6\uff0c\u5219\u8c03\u7528newsky.css<\/p>\n<p>\u7528\u6cd5\uff1a<br \/>&nbsp;\u653e\u5728<br \/>&nbsp;&lt;\/head&gt;\u524d\u9762\u5373\u53ef\u3002<\/p>\n<p><\/p>\n<p> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0d\u540c\u6d4f\u89c8\u5668\u4e0d\u540c\u5c4f\u5e55\u5206\u8fa8\u7387\u81ea\u52a8\u8c03\u7528\u4e0d\u540cCSS\u7684\u4ee3\u7801\u3002\u65e2\u5224\u65ad\u6d4f\u89c8\u5668\uff0c\u4e5f\u5224\u65ad\u5206\u8fa8\u7387\u3002 \u3010\u8f6c\u3011http:\/\/www.s [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-279","post","type-post","status-publish","format-standard","hentry","category-4"],"_links":{"self":[{"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/posts\/279","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/comments?post=279"}],"version-history":[{"count":0,"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/posts\/279\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/media?parent=279"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/categories?post=279"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/tags?post=279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}