<?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; html</title>
	<atom:link href="http://www.simcn.com/tag/html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.simcn.com</link>
	<description>网站开发, 前端开发, 高性能前端开发</description>
	<lastBuildDate>Thu, 03 Nov 2011 02:08:49 +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>直接使用网页进行打印</title>
		<link>http://www.simcn.com/web-print_js-print_css-print</link>
		<comments>http://www.simcn.com/web-print_js-print_css-print#comments</comments>
		<pubDate>Tue, 14 Sep 2010 08:03:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[前端技术]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[print]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.simcn.com/?p=311</guid>
		<description><![CDATA[网页打印内容有很多便利的地方，而且不需要安装其他软件 会打印机页眉与页脚并且在有些在程序中不好去掉. &#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62; &#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34; xml:lang=&#34;en&#34;&#62; &#60;head&#62; &#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html;charset=UTF-8&#34; /&#62; &#60;title&#62;&#60;/title&#62; &#60;style type=&#34;text/css&#34; media=&#34;print&#34;&#62; *{margin:0; padding:0;} p{ background-color:#333; color:#fff; margin:1mm;} .page-break-after{page-break-after : always} button{display:none;} &#60;/style&#62; &#60;script type=&#34;text/javascript&#34;&#62; function webprint(){ window.print(); } &#60;/script&#62; &#60;/head&#62; &#60;body&#62; &#60;p&#62;1&#60;/p&#62; &#60;div class=&#34;page-break-after&#34;&#62;&#38;nbsp;&#60;/div&#62; &#60;p&#62;2&#60;/p&#62; &#60;div class=&#34;page-break-after&#34;&#62;&#38;nbsp;&#60;/div&#62; &#60;p&#62;3&#60;/p&#62; &#60;button onclick=&#34;webprint()&#34;&#62;print&#60;/button&#62; &#60;/body&#62; &#60;/html&#62;]]></description>
			<content:encoded><![CDATA[<p>网页打印内容有很多便利的地方，而且不需要安装其他软件</p>
<p>会打印机页眉与页脚并且在有些在程序中不好去掉.</p>
<pre name="code" class="brush:html">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot;&gt;
&lt;head&gt;
	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html;charset=UTF-8&quot; /&gt;
	&lt;title&gt;&lt;/title&gt;

	&lt;style type=&quot;text/css&quot; media=&quot;print&quot;&gt;
		*{margin:0; padding:0;}
		p{ background-color:#333; color:#fff; margin:1mm;}
		.page-break-after{page-break-after : always}
		button{display:none;}
	&lt;/style&gt;
	&lt;script type=&quot;text/javascript&quot;&gt;
	function webprint(){
		window.print();
	}
	&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;p&gt;1&lt;/p&gt;
	&lt;div class=&quot;page-break-after&quot;&gt;&amp;nbsp;&lt;/div&gt;
	&lt;p&gt;2&lt;/p&gt;
	&lt;div class=&quot;page-break-after&quot;&gt;&amp;nbsp;&lt;/div&gt;
	&lt;p&gt;3&lt;/p&gt;
	&lt;button onclick=&quot;webprint()&quot;&gt;print&lt;/button&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.simcn.com/web-print_js-print_css-print/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用a模拟submit按钮事件</title>
		<link>http://www.simcn.com/a_submit_event</link>
		<comments>http://www.simcn.com/a_submit_event#comments</comments>
		<pubDate>Thu, 02 Sep 2010 08:47:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[默认分类]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[模拟]]></category>

		<guid isPermaLink="false">http://www.simcn.com/?p=306</guid>
		<description><![CDATA[优点：样式可控制性强，可以加不同的状态，兼容ie6. 可扩展性好 缺点: 需要增加js，如果禁用ＪＳ可能不能使用.  需要多增加一个a标签。 提交提交 如果直接隐藏在from 中有多个表单无件时无效，求解 .btn_a_submit{ position:absolute; left:-1000px; top:0px;}]]></description>
			<content:encoded><![CDATA[<p>优点：样式可控制性强，可以加不同的状态，兼容ie6. 可扩展性好</p>
<p>缺点: 需要增加js，如果禁用ＪＳ可能不能使用.  需要多增加一个a标签。</p>
<pre class="brush:html" name="code">
<form name="form1" method="post" action="?id=3" id="form1">
<input type="text" name="a" id="a" />
<input type="text" name="b" id="b" />
<input type="text" name="c" id="c" />
<input class="btn_a_submit" id='s2' name="s2" type="submit" value="提交" />
<a href="javascript:document.getElementById('s2').click();" class="btnlink_b_small " ><span>提交提交</span></a>
</form>
</pre>
<p>如果直接隐藏在from 中有多个表单无件时无效，求解 </p>
<pre class="brush:css" name="code">

.btn_a_submit{ position:absolute; left:-1000px; top:0px;}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.simcn.com/a_submit_event/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>通过script标签增加JS</title>
		<link>http://www.simcn.com/script_src_add_script_js</link>
		<comments>http://www.simcn.com/script_src_add_script_js#comments</comments>
		<pubDate>Sun, 21 Feb 2010 10:48:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[前端技术]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.simcn.com/?p=253</guid>
		<description><![CDATA[工作需要在前端的代码通过xxx.js?m=m&#038;x=x 的方法来通过js加载JS文件。 JS: //MS闭包，不让代码互相影响，我也用的不多 (function(){ var simcn = { src:[], init:function(){ var __g = document.getElementById('simcnworkframe'); this.srcUrl(__g.src); }, run:function(){ this.init(); var head = document.getElementsByTagName('head')[0]; var j=0; for(i in this.src){ var t = document.createElement('script'); t.src = this.src[i] + '.js' ; t.id = "simc_" + this.src[i]; head.appendChild(t); } }, srcUrl:function(_u){ var jl = _u.split('.js?')[1].split('&#038;'); for(i in jl){ this.src.push(jl[i].split('=')[1]); [...]]]></description>
			<content:encoded><![CDATA[<p>工作需要在前端的代码通过xxx.js?m=m&#038;x=x 的方法来通过js加载JS文件。</p>
<pre class="brush:html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <script type="text/javascript" id="simcnworkframe" src="simcn.js?m=m&#038;c=c&#038;v=v">
        </script>
    </head>
    <body>
     </body>
</html>
</pre>
<p>JS:</p>
<pre class="brush:javascript">
//MS闭包，不让代码互相影响，我也用的不多
(function(){

	var simcn = {
		src:[],
		init:function(){
			var __g = document.getElementById('simcnworkframe');
			this.srcUrl(__g.src);
		},
		run:function(){
			this.init();
			var head = document.getElementsByTagName('head')[0];
			var j=0;
			for(i in this.src){
				var t = document.createElement('script');
				t.src = this.src[i] + '.js' ;
				t.id  = "simc_" + this.src[i];
				head.appendChild(t);
			}
		},
		srcUrl:function(_u){
			var jl = _u.split('.js?')[1].split('&#038;');
			for(i in jl){
				this.src.push(jl[i].split('=')[1]);
			}
		}
	};	

	simcn.run();

})()

//m.js
alert('m.js')

//c.js
alert('c.js')

//v.js
alert('v.js')
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.simcn.com/script_src_add_script_js/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>今天写的一个练习的js类模式</title>
		<link>http://www.simcn.com/oo-javascript</link>
		<comments>http://www.simcn.com/oo-javascript#comments</comments>
		<pubDate>Wed, 10 Jun 2009 11:36:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[默认分类]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[oo]]></category>
		<category><![CDATA[滚动]]></category>

		<guid isPermaLink="false">http://www.simcn.com/2009/06/%e4%bb%8a%e5%a4%a9%e5%86%99%e7%9a%84%e4%b8%80%e4%b8%aa%e7%bb%83%e4%b9%a0%e7%9a%84js%e7%b1%bb%e6%a8%a1%e5%bc%8f/</guid>
		<description><![CDATA[suspendcode="" document.write(suspendcode); var hp = { lastScrollY : 0, byID : function(_id){ return document.getElementById(_id);}, init : function(id){ var st = document.documentElement.scrollTop &#124;&#124; document.body.scrollTop; percent=.1*(st-this.lastScrollY); if(percent>0){ percent=Math.ceil(percent); }else{ percent=Math.floor(percent); } this.byID(id).style.top=parseInt(this.byID(id).style.top)+percent+"px"; this.lastScrollY=this.lastScrollY+percent; return id; }, generate : function(){ }, start : function(id){ window.setInterval("hp.init(’"+id+"’)",1); } }; #hp.start(’lovexin1′);]]></description>
			<content:encoded><![CDATA[<pre name="code" class="brush:javascript">
suspendcode="<DIV id=lovexin1 style=’Z-INDEX: 10; LEFT: 6px; POSITION: absolute; TOP: 105px; width: 100; height: 300px;’><img src=’images/close.gif’ onClick=’javascript:window.hide()’ width=’100′ height=’14′ border=’0′ vspace=’3′ alt=’关闭对联广告’><a href=’http://www.58ka.com.cn/’ target=’_blank’><img src=’images/ad_100×300.jpg’ width=’100′ height=’300′ border=’0′></a></DIV>"
document.write(suspendcode);

var hp = {

lastScrollY : 0, 

byID : function(_id){ return document.getElementById(_id);},

init : function(id){
var st = document.documentElement.scrollTop || document.body.scrollTop;
percent=.1*(st-this.lastScrollY);
if(percent>0){
percent=Math.ceil(percent);
}else{
percent=Math.floor(percent);
}

this.byID(id).style.top=parseInt(this.byID(id).style.top)+percent+"px";
this.lastScrollY=this.lastScrollY+percent;
return id;
},

generate : function(){

},

start : function(id){
window.setInterval("hp.init(’"+id+"’)",1);
} 

}; 

#hp.start(’lovexin1′); 
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.simcn.com/oo-javascript/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>让ul与li水平居中，常用于页面居中导航</title>
		<link>http://www.simcn.com/%e8%ae%a9ul%e4%b8%8eli%e6%b0%b4%e5%b9%b3%e5%b1%85%e4%b8%ad%ef%bc%8c%e5%b8%b8%e7%94%a8%e4%ba%8e%e9%a1%b5%e9%9d%a2%e5%b1%85%e4%b8%ad%e5%af%bc%e8%88%aa</link>
		<comments>http://www.simcn.com/%e8%ae%a9ul%e4%b8%8eli%e6%b0%b4%e5%b9%b3%e5%b1%85%e4%b8%ad%ef%bc%8c%e5%b8%b8%e7%94%a8%e4%ba%8e%e9%a1%b5%e9%9d%a2%e5%b1%85%e4%b8%ad%e5%af%bc%e8%88%aa#comments</comments>
		<pubDate>Tue, 14 Oct 2008 03:53:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[前端技术]]></category>
		<category><![CDATA[css布局]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[导航]]></category>
		<category><![CDATA[水平居中]]></category>
		<category><![CDATA[菜单]]></category>

		<guid isPermaLink="false">http://www.simcn.com/?p=7</guid>
		<description><![CDATA[&#60;html xmlns=”http://www.w3.org/1999/xhtml“&#62; &#60;head&#62; &#60;meta http-equiv=”Content-Type” content=”text/html; charset=utf-8&#8243; /&#62; &#60;title&#62;无标题文档-SH!&#60;/title&#62; &#60;style&#62; ul,li{ margin:0; padding:0; list-style:none; } #area{ width:100%; height:80px; background-color:#eee; text-align:center; overflow:hidden; } #area ul{ float:left; position:relative; left:50%; } #area ul li{ float:left; margin:10px; padding:0 10px; position:relative; right:50%; line-height:60px; border:solid 1px #000; } &#60;/style&#62; &#60;/head&#62; &#60;body&#62; &#60;h1&#62;跨浏览器实现float:center&#60;/h1&#62; &#60;div id=”area”&#62; &#60;ul &#62; &#60;li&#62;列表一,我是浮动的&#60;/li&#62; &#60;li&#62;列表二&#60;/li&#62; &#60;li&#62;列表三&#60;/li&#62; &#60;li&#62;这里可能是N&#60;/li&#62; &#60;/ul&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>&lt;html xmlns=”<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>“&gt;<br />
&lt;head&gt;<br />
&lt;meta http-equiv=”Content-Type” content=”text/html; charset=utf-8&#8243; /&gt;<br />
&lt;title&gt;无标题文档-SH!&lt;/title&gt;<br />
&lt;style&gt;<br />
ul,li{<br />
margin:0;<br />
padding:0;<br />
list-style:none;<br />
}<br />
#area{<br />
width:100%;<br />
height:80px;<br />
background-color:#eee;<br />
text-align:center;<br />
overflow:hidden;<br />
}<br />
#area ul{<br />
float:left;<br />
position:relative;<br />
left:50%;<br />
}<br />
#area ul li{<br />
float:left;<br />
margin:10px;<br />
padding:0 10px;<br />
position:relative;<br />
right:50%;<br />
line-height:60px;<br />
border:solid 1px #000;<br />
}<br />
&lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;h1&gt;跨浏览器实现float:center&lt;/h1&gt;<br />
&lt;div id=”area”&gt;<br />
&lt;ul &gt;<br />
&lt;li&gt;列表一,我是浮动的&lt;/li&gt;<br />
&lt;li&gt;列表二&lt;/li&gt;<br />
&lt;li&gt;列表三&lt;/li&gt;<br />
&lt;li&gt;这里可能是N&lt;/li&gt;<br />
&lt;/ul&gt;<br />
&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simcn.com/%e8%ae%a9ul%e4%b8%8eli%e6%b0%b4%e5%b9%b3%e5%b1%85%e4%b8%ad%ef%bc%8c%e5%b8%b8%e7%94%a8%e4%ba%8e%e9%a1%b5%e9%9d%a2%e5%b1%85%e4%b8%ad%e5%af%bc%e8%88%aa/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

