<?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.artcss.com/archives/tag/%e6%bb%91%e5%8a%a8%e9%97%a8/feed" rel="self" type="application/rss+xml" />
	<link>http://www.artcss.com</link>
	<description>一个像素的距离...</description>
	<lastBuildDate>Sat, 12 Feb 2011 03:34:07 +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>仿126经典滑动门</title>
		<link>http://www.artcss.com/archives/471.html</link>
		<comments>http://www.artcss.com/archives/471.html#comments</comments>
		<pubDate>Wed, 01 Jul 2009 05:43:42 +0000</pubDate>
		<dc:creator>Artcss</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[js tab]]></category>
		<category><![CDATA[滑动门]]></category>

		<guid isPermaLink="false">http://artskin.jhost.cn/blog/?p=3</guid>
		<description><![CDATA[javascript仿126邮箱广告Tab切换效果，是我见过写得最精炼的Tab，大家引用时保留下原创作者 鼠标点击 &#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;&#62; &#60;head&#62; &#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=gb2312&#34; /&#62; &#60;title&#62;仿126经典滑动门 &#60;/title&#62; &#60;style&#62; &#60;!-- body,div,ul,li{ padding:0; text-align:center; } body{ font:12px &#34;宋体&#34;; text-align:center; } a:link{ color:#00F; text-decoration:none; } a:visited { color: #00F; text-decoration:none; } a:hover { color: #c00; text-decoration:underline; } ul{ list-style:none;} /*选项卡1*/ #Tab1{ width:460px; margin:0px; padding:0px; margin:0 [...]]]></description>
			<content:encoded><![CDATA[<p>javascript仿126邮箱广告Tab切换效果，是我见过写得最精炼的Tab，大家引用时保留下原创作者  </p>
<h4>鼠标点击</h4>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_9CBPrB">
&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;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=gb2312&quot; /&gt;
&lt;title&gt;仿126经典滑动门 &lt;/title&gt;
&lt;style&gt;
&lt;!--
body,div,ul,li{  padding:0;  text-align:center; }
body{  font:12px &quot;宋体&quot;;  text-align:center; }
a:link{  color:#00F;  text-decoration:none; }
a:visited {  color: #00F;  text-decoration:none; }
a:hover {  color: #c00;  text-decoration:underline; }
ul{ list-style:none;}
/*选项卡1*/
#Tab1{ width:460px; margin:0px; padding:0px; margin:0 auto;}
/*选项卡2*/
#Tab2{ width:576px; margin:0px; padding:0px; margin:0 auto;}
/*菜单class*/
.Menubox { width:100%; background:url(/uploads/img/tab_bg.gif); height:28px; line-height:28px; }
.Menubox ul{ margin:0px; padding:0px; }
.Menubox li{  float:left;  display:block;  cursor:pointer;  width:114px;  text-align:center;  color:#949694;  font-weight:bold;  }
.Menubox li.hover{  padding:0px;  background:#fff;  width:116px;  border-left:1px solid #A8C29F;  border-top:1px solid #A8C29F;  border-right:1px solid #A8C29F; background:url(/uploads/img/tab_hover.gif);  color:#739242;  font-weight:bold;  height:27px; line-height:27px; }
.Contentbox{  clear:both;  margin-top:0px;  border:1px solid #A8C29F;  border-top:none;  height:181px;  text-align:center;  padding-top:8px; } --&gt;
&lt;/style&gt;
&lt;script type=&quot;text/javascript&quot;&gt;// &lt;![CDATA[
/*第一种形式 第二种形式 更换显示样式*/
function setTab(name,cursel,n){
 for(i=1;i&lt;=n;i++){
  var menu=document.getElementById(name+i);
  var con=document.getElementById(&quot;con_&quot;+name+&quot;_&quot;+i);
  menu.className=i==cursel?&quot;hover&quot;:&quot;&quot;;
  con.style.display=i==cursel?&quot;block&quot;:&quot;none&quot;;
 }
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;!--
引用时保留下原创作者喽,尊重任articleimg何一位原创作者,促进中国互联网进程
Editor:weasle
http://www.hxcgw.com
Email:weasle@163.com
QQ:112011531
--&gt;
&lt;div id=&quot;Tab1&quot;&gt;
&lt;div class=&quot;Menubox&quot;&gt;
&lt;ul&gt;
	&lt;li id=&quot;one1&quot; class=&quot;hover&quot; onclick=&quot;setTab('one',1,4)&quot;&gt;新闻1&lt;/li&gt;
	&lt;li id=&quot;one2&quot; onclick=&quot;setTab('one',2,4)&quot;&gt;新闻2&lt;/li&gt;
	&lt;li id=&quot;one3&quot; onclick=&quot;setTab('one',3,4)&quot;&gt;新闻3&lt;/li&gt;
	&lt;li id=&quot;one4&quot; onclick=&quot;setTab('one',4,4)&quot;&gt;新闻4&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;Contentbox&quot;&gt;
&lt;div id=&quot;con_one_1&quot; class=&quot;hover&quot;&gt;新闻列表1&lt;/div&gt;
&lt;div id=&quot;con_one_2&quot; style=&quot;display:none&quot;&gt;新闻列表2&lt;/div&gt;
&lt;div id=&quot;con_one_3&quot; style=&quot;display:none&quot;&gt;新闻列表3&lt;/div&gt;
&lt;div id=&quot;con_one_4&quot; style=&quot;display:none&quot;&gt;新闻列表4&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div id=&quot;Tab2&quot;&gt;
&lt;div class=&quot;Menubox&quot;&gt;
&lt;ul&gt;
	&lt;li id=&quot;two1&quot; class=&quot;hover&quot; onclick=&quot;setTab('two',1,4)&quot;&gt;新闻1&lt;/li&gt;
	&lt;li id=&quot;two2&quot; onclick=&quot;setTab('two',2,4)&quot;&gt;新闻2&lt;/li&gt;
	&lt;li id=&quot;two3&quot; onclick=&quot;setTab('two',3,4)&quot;&gt;新闻3&lt;/li&gt;
	&lt;li id=&quot;two4&quot; onclick=&quot;setTab('two',4,4)&quot;&gt;新闻4&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;Contentbox&quot;&gt;
&lt;div id=&quot;con_two_1&quot;&gt;新闻列表1&lt;/div&gt;
&lt;div id=&quot;con_two_2&quot; style=&quot;display:none&quot;&gt;新闻列表2&lt;/div&gt;
&lt;div id=&quot;con_two_3&quot; style=&quot;display:none&quot;&gt;新闻列表3&lt;/div&gt;
&lt;div id=&quot;con_two_4&quot; style=&quot;display:none&quot;&gt;新闻列表4&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_9CBPrB');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_9CBPrB');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p><br ></p>
<h4>鼠标滑过：</h4>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_drjf_Y">
&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;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=gb2312&quot; /&gt;
&lt;title&gt;仿126经典滑动门&lt;/title&gt;
&lt;style&gt;
&lt;!-- body,div,ul,li{  padding:0;  text-align:center; }
body{  font:12px &quot;宋体&quot;;  text-align:center; }
a:link{  color:#00F;  text-decoration:none; }
a:visited {  color: #00F;  text-decoration:none; }
a:hover {  color: #c00;  text-decoration:underline; }
ul{ list-style:none;}
/*选项卡1*/
#Tab1{ width:460px; margin:0px; padding:0px; margin:0 auto;}
/*选项卡2*/
#Tab2{ width:576px; margin:0px; padding:0px; margin:0 auto;}
/*菜单class*/
.Menubox { width:100%; background:url(/uploads/img/tab_bg.gif); height:28px; line-height:28px; }
.Menubox ul{ margin:0px; padding:0px; }
.Menubox li{  float:left;  display:block;  cursor:pointer;  width:114px;  text-align:center;  color:#949694;  font-weight:bold;  }
.Menubox li.hover{  padding:0px;  background:#fff;  width:116px;  border-left:1px solid #A8C29F;  border-top:1px solid #A8C29F;  border-right:1px solid #A8C29F;  background:url(/uploads/img/tab_hover.gif);  color:#739242;  font-weight:bold;  height:27px;  line-height:27px; }
.Menubox_on {  padding:0px;  background:#fff;  width:116px;  border-left:1px solid #A8C29F;  border-top:1px solid #A8C29F;  border-right:1px solid #A8C29F;  background:url(http://bbs.blueidea.com/attachment.php?aid=61412&amp;#038;noupdate=yes);  color:#739242;  font-weight:bold;  height:27px;  line-height:27px;  }
.Contentbox{  clear:both;  margin-top:0px;  border:1px solid #A8C29F;  border-top:none;  height:181px;  text-align:center;  padding-top:8px; } --&gt;
&lt;/style&gt;
&lt;script type=&quot;text/javascript&quot;&gt;// &lt;![CDATA[
/*第一种形式 第二种形式 更换显示样式*/
function setTab(name,cursel,n){
 for(i=1;i&lt;=n;i++){
  var menu=document.getElementById(name+i);
  var con=document.getElementById(&quot;con_&quot;+name+&quot;_&quot;+i);
  menu.className=i==cursel?&quot;hover&quot;:&quot;&quot;;
  con.style.display=i==cursel?&quot;block&quot;:&quot;none&quot;;
 }
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;!--
引用时保留下原创作者喽,尊重任何一位原创作者,促进中国互联网进程
Editor:weasle
http://www.hxcgw.com
Email:weasle@163.com
QQ:112011531
--&gt;
&lt;div id=&quot;Tab1&quot;&gt;
&lt;div class=&quot;Menubox&quot;&gt;
&lt;ul&gt;
	&lt;li id=&quot;one1&quot; class=&quot;hover&quot; onmouseover=&quot;setTab('one',1,4)&quot;&gt;新闻1&lt;/li&gt;
	&lt;li id=&quot;one2&quot; onmouseover=&quot;setTab('one',2,4)&quot;&gt;新闻2&lt;/li&gt;
	&lt;li id=&quot;one3&quot; onmouseover=&quot;setTab('one',3,4)&quot;&gt;新闻3&lt;/li&gt;
	&lt;li id=&quot;one4&quot; onmouseover=&quot;setTab('one',4,4)&quot;&gt;新闻4&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;Contentbox&quot;&gt;
&lt;div id=&quot;con_one_1&quot;&gt;新闻列表1&lt;/div&gt;
&lt;div id=&quot;con_one_2&quot; style=&quot;display:none&quot;&gt;新闻列表2&lt;/div&gt;
&lt;div id=&quot;con_one_3&quot; style=&quot;display:none&quot;&gt;新闻列表3&lt;/div&gt;
&lt;div id=&quot;con_one_4&quot; style=&quot;display:none&quot;&gt;新闻列表4&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div id=&quot;Tab2&quot;&gt;
&lt;div class=&quot;Menubox&quot;&gt;
&lt;ul&gt;
	&lt;li id=&quot;two1&quot; onmouseover=&quot;setTab('two',1,4)&quot;&gt;新闻1&lt;/li&gt;
	&lt;li id=&quot;two2&quot; class=&quot;Menubox_on&quot; onmouseover=&quot;setTab('two',2,4)&quot;&gt;新闻2&lt;/li&gt;
	&lt;li id=&quot;two3&quot; onmouseover=&quot;setTab('two',3,4)&quot;&gt;新闻3&lt;/li&gt;
	&lt;li id=&quot;two4&quot; onmouseover=&quot;setTab('two',4,4)&quot;&gt;新闻4&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;Contentbox&quot;&gt;
&lt;div id=&quot;con_two_1&quot; style=&quot;display:none&quot;&gt;新闻列表1&lt;/div&gt;
&lt;div id=&quot;con_two_2&quot;&gt;新闻列表2&lt;/div&gt;
&lt;div id=&quot;con_two_3&quot; style=&quot;display:none&quot;&gt;新闻列表3&lt;/div&gt;
&lt;div id=&quot;con_two_4&quot; style=&quot;display:none&quot;&gt;新闻列表4&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_drjf_Y');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_drjf_Y');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<h4>javascript代码如下：</h4>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left2">Download <a href="http://www.artcss.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=471&amp;download=script.js">script.js</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p4712"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code" id="p471code2"><pre class="javascript" style="font-family:Verdana;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span><span style="color: #999999;">// &lt;![CDATA[</span>
<span style="color: #009966; ">/*第一种形式 第二种形式 更换显示样式*/</span>
<span style="color: #003366; font-weight: bold;">function</span> setTab<span style="color: #009900;">&#40;</span><span style="color: #000066;">name</span><span style="color: #339933;">,</span>cursel<span style="color: #339933;">,</span>n<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #ff0000;">1</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;=</span>n<span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> menu<span style="color: #339933;">=</span>document.<span style="color: #990000;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #000066;">name</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> con<span style="color: #339933;">=</span>document.<span style="color: #990000;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;con_&quot;</span><span style="color: #339933;">+</span><span style="color: #000066;">name</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;_&quot;</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  menu.<span style="color: #990000;">className</span><span style="color: #339933;">=</span>i<span style="color: #339933;">==</span>cursel<span style="color: #339933;">?</span><span style="color: #3366CC;">&quot;hover&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
  con.<span style="color: #990000;">style</span>.<span style="color: #990000;">display</span><span style="color: #339933;">=</span>i<span style="color: #339933;">==</span>cursel<span style="color: #339933;">?</span><span style="color: #3366CC;">&quot;block&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;none&quot;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #999999;">// ]]&gt;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.artcss.com/archives/471.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

