{"id":671,"date":"2011-01-28T09:55:07","date_gmt":"2011-01-28T01:55:07","guid":{"rendered":""},"modified":"2014-03-11T22:36:22","modified_gmt":"2014-03-11T14:36:22","slug":"javascript%e6%bb%9a%e5%8a%a8%e6%96%b0%e9%97%bb%e7%b1%bb","status":"publish","type":"post","link":"http:\/\/www.xiaoyebailong.com\/index.php\/2011\/01\/28\/671.htm","title":{"rendered":"JavaScript\u6eda\u52a8\u65b0\u95fb\u7c7b"},"content":{"rendered":"<p>&lt;!DOCTYPE html PUBLIC &quot;-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN&quot; &quot;<a rel=\"nofollow\" href=\"http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd\" target=\"_blank\">http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd<\/a>&quot;&gt;<br \/>\n&lt;html xmlns=&quot;<a rel=\"nofollow\" href=\"http:\/\/www.w3.org\/1999\/xhtml\" target=\"_blank\">http:\/\/www.w3.org\/1999\/xhtml<\/a>&quot;&gt;<br \/>\n&lt;head&gt;<br \/>\n&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text\/html; charset=utf-8&quot; \/&gt;<br \/>\n&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=EmulateIE7&quot; \/&gt;<br \/>\n&lt;title&gt;\u6eda\u52a8\u65b0\u95fb\u7c7b &#8211; 51js.com &#8211; biyuan&lt;\/title&gt;<br \/>\n&lt;style type=&quot;text\/css&quot;&gt;<br \/>\nbody {<br \/>\ntext-align:center;<br \/>\n}<br \/>\ntd {<br \/>\nfont-size:12px;<br \/>\nline-height:20px;<br \/>\ntext-align:left;<br \/>\n}<br \/>\n.marquee {<br \/>\nwidth:100%;<br \/>\nheight:100%;<br \/>\noverflow:hidden;<br \/>\n}<br \/>\n.m {<br \/>\nheight:20px;<br \/>\n}<br \/>\n.m2 {<br \/>\nheight:90px;<br \/>\n}<br \/>\n&lt;\/style&gt;<br \/>\n&lt;\/head&gt;<br \/>\n&lt;body&gt;<br \/>\n&lt;table border=&#8217;1&#8242;&gt;<br \/>\n&lt;tr&gt;<br \/>\n&lt;td height=&#8217;20&#8217; width=&#8217;250&#8242;&gt;&lt;div id=&#8217;marquee1&#8242; class=&#8217;marquee m&#8217;&gt;&lt;\/div&gt;&lt;\/td&gt;<br \/>\n&lt;td height=&#8217;20&#8217; width=&#8217;300&#8242;&gt;&lt;div id=&#8217;marquee2&#8242; class=&#8217;marquee m&#8217;&gt;&lt;\/div&gt;&lt;\/td&gt;<br \/>\n&lt;\/tr&gt;<br \/>\n&lt;tr&gt;<br \/>\n&lt;td height=&#8217;99&#8217; colspan=&#8217;2&#8242;&gt;\u57fa\u672c\u4e0a\u591f\u7528\u4e86\u5427\uff01&lt;\/td&gt;<br \/>\n&lt;\/tr&gt;<br \/>\n&lt;tr&gt;<br \/>\n&lt;td height=&#8217;90&#8217; colspan=&#8217;2&#8242;&gt;&lt;div id=&#8217;marquee3&#8242; class=&#8217;marquee m2&#8242;&gt;&lt;\/div&gt;&lt;\/td&gt;<br \/>\n&lt;\/tr&gt;<br \/>\n&lt;\/table&gt;<br \/>\n&lt;script language=&quot;JavaScript&quot;&gt;<br \/>\nfunction BYMarquee(){<br \/>\nthis.Content = []; \/\/\u663e\u793a\u5185\u5bb9<br \/>\nthis.Speed = 20; \/\/\u4e0a\u79fb\u901f\u5ea6<br \/>\nthis.Object = {}; \/\/marquee\u5bb9\u5668\u5bf9\u8c61<br \/>\nthis.Pause = true; \/\/\u662f\u5426\u505c\u7559<br \/>\nthis.Start = function(){<br \/>\nvar o = this.Object;<br \/>\nvar Pause = this.Pause;<br \/>\nvar Stop = false;<br \/>\nvar Stop2 = false;<br \/>\no.onmouseover = function(){<br \/>\nStop = Stop2 = true;<br \/>\n}<br \/>\no.onmouseout = function(){<br \/>\nStop = Stop2 = false;<br \/>\n}<br \/>\nvar BodyHtml = [];<br \/>\nfor(var i in this.Content){<br \/>\nBodyHtml.push(&quot;&lt;a href=\\&quot;&quot; + this.Content[i].link + &quot;\\&quot;&gt;&quot; + this.Content[i].text + &quot;&lt;\/a&gt;&quot;);<br \/>\n}<br \/>\nvar Dv = document.createElement(&quot;div&quot;);<br \/>\nDv.innerHTML = BodyHtml.join(&quot;&lt;br \/&gt;&quot;);<br \/>\no.appendChild(Dv);<br \/>\nvar DvHeight = Dv.offsetHeight;<br \/>\nwhile(Dv.offsetHeight \/ 2 &lt; o.offsetHeight){<br \/>\nDv.innerHTML += &quot;&lt;br \/&gt;&quot; + Dv.innerHTML;<br \/>\n}<br \/>\nDv.innerHTML += &quot;&lt;br \/&gt;&quot; + Dv.innerHTML;<br \/>\nsetInterval(function(){<br \/>\nif(!Stop){<br \/>\no.scrollTop ++;<br \/>\nif(o.scrollTop == o.scrollHeight &#8211; o.offsetHeight){<br \/>\no.scrollTop = DvHeight &#8211; o.offsetHeight;<br \/>\n}<br \/>\nif(Pause){<br \/>\nif(o.scrollTop % o.offsetHeight == 0){<br \/>\nStop = true;<br \/>\nsetTimeout(function(){<br \/>\nStop = Stop2;<br \/>\n}, 3000);<br \/>\n}<br \/>\n}<br \/>\n}<br \/>\n}, this.Speed);<br \/>\n}<br \/>\n}<br \/>\n\/\/\u5b9e\u4f8b1<br \/>\nvar marquee1 = new BYMarquee();<br \/>\nmarquee1.Content = [<br \/>\n{link : &#8216;#&#8217;, text : &#8216;\u82f1\u6cd5\u56fd\u9632\u90e8\u8bc1\u5b9e\u4e24\u56fd\u6838\u6f5c\u8247\u76f8\u649e&#8217;},<br \/>\n{link : &#8216;#&#8217;, text : &#8216;\u4e2d\u56fd\u8d74\u6b27\u91c7\u8d2d\u6e05\u5355\u6572\u5b9a \u6d89\u53ca\u91d1\u989d150\u4ebf\u5143&#8217;}<br \/>\n];<br \/>\nmarquee1.Object = document.getElementById(&#8216;marquee1&#8217;);<br \/>\nmarquee1.Start();<br \/>\n\/\/\u5b9e\u4f8b2<br \/>\nvar marquee2 = new BYMarquee();<br \/>\nmarquee2.Content = [<br \/>\n{link : &#8216;#&#8217;, text : &#8216;\u5251\u4ed9\u674e\u6a2a\u63e1\u950b\u5229\u56a3\u5f20\u7684\u5730\u94dc\u5251\uff0c\u5de6\u53f3\u6643\u52a8&#8217;},<br \/>\n{link : &#8216;#&#8217;, text : &#8216;\u4f60\u7684\u5974\u96b6\u3010\u5251\u4ed9\u674e\u3011\u594b\u8d77\u53cd\u6297\uff0c\u88ab\u4f60\u72e0\u72e0\u5730\u6559\u8bad\u4e86\u4e00\u987f\uff01&#8217;},<br \/>\n{link : &#8216;#&#8217;, text : &#8216;\u6211\u7684\u5974\u96b6 Su.\u65b0\u6b66\u5c06 \u5728\u5974\u96b6\u5e02\u573a\u8f93\u7ed9\u4e86 \u91d1\u5149\u707f\u70c2&#8217;}<br \/>\n];<br \/>\nmarquee2.Speed = 10;<br \/>\nmarquee2.Object = document.getElementById(&#8216;marquee2&#8217;);<br \/>\nmarquee2.Start();<br \/>\n\/\/\u5b9e\u4f8b3<br \/>\nvar marquee3 = new BYMarquee();<br \/>\nmarquee3.Content = [<br \/>\n{link : &#8216;#&#8217;, text : &#8216;\u5173\u4e8e\u5c01\u88c5\u7684\u65b9\u6cd5\u4e4b\u95f4\u8c03\u7528\u7684\u95ee\u9898\u6c42\u52a9&#8217;},<br \/>\n{link : &#8216;#&#8217;, text : &#8216;\u5982\u4f55\u7528Javascript\u6765\u5220\u9664\u6d4f\u89c8\u5668\u7684\u5386\u53f2\u8bb0\u5f55\uff1f&#8217;},<br \/>\n{link : &#8216;#&#8217;, text : &#8216;\u8bf7\u9ad8\u624b\u5e2e\u5fd9\u7834\u89e3\u4e00\u6bb5\u4ee3\u7801&#8217;}<br \/>\n];<br \/>\nmarquee3.Speed = 50;<br \/>\nmarquee3.Pause = false;<br \/>\nmarquee3.Object = document.getElementById(&#8216;marquee3&#8217;);<br \/>\nmarquee3.Start();<\/p>\n<p>\n&nbsp;<\/p>\n<p>\/\/\u9500\u6bc1<br \/>\nmarquee1 = marquee2 = marquee3 = null;<br \/>\n&lt;\/script&gt;<br \/>\n&lt;\/body&gt;<br \/>\n&lt;\/html&gt;<br \/>\n&lt;title&gt;\u6eda\u52a8\u65b0\u95fb\u7c7b &#8211; 51js.com &#8211; biyuan&lt;\/title&gt;<br \/>\n&lt;style type=&quot;text\/css&quot;&gt;<br \/>\nbody {<br \/>\ntext-align:center;<br \/>\n}<br \/>\ntd {<br \/>\nfont-size:12px;<br \/>\nline-height:20px;<br \/>\ntext-align:left;<br \/>\n}<br \/>\n.marquee {<br \/>\nwidth:100%;<br \/>\nheight:100%;<br \/>\noverflow:hidden;<br \/>\n}<br \/>\n.m {<br \/>\nheight:20px;<br \/>\n}<br \/>\n.m2 {<br \/>\nheight:90px;<br \/>\n}<br \/>\n&lt;\/style&gt;<br \/>\n&lt;\/head&gt;<br \/>\n&lt;body&gt;<br \/>\n&lt;table border=&#8217;1&#8242;&gt;<br \/>\n&lt;tr&gt;<br \/>\n&lt;td height=&#8217;20&#8217; width=&#8217;250&#8242;&gt;&lt;div id=&#8217;marquee1&#8242; class=&#8217;marquee m&#8217;&gt;&lt;\/div&gt;&lt;\/td&gt;<br \/>\n&lt;td height=&#8217;20&#8217; width=&#8217;300&#8242;&gt;&lt;div id=&#8217;marquee2&#8242; class=&#8217;marquee m&#8217;&gt;&lt;\/div&gt;&lt;\/td&gt;<br \/>\n&lt;\/tr&gt;<br \/>\n&lt;tr&gt;<br \/>\n&lt;td height=&#8217;99&#8217; colspan=&#8217;2&#8242;&gt;\u57fa\u672c\u4e0a\u591f\u7528\u4e86\u5427\uff01&lt;\/td&gt;<br \/>\n&lt;\/tr&gt;<br \/>\n&lt;tr&gt;<br \/>\n&lt;td height=&#8217;90&#8217; colspan=&#8217;2&#8242;&gt;&lt;div id=&#8217;marquee3&#8242; class=&#8217;marquee m2&#8242;&gt;&lt;\/div&gt;&lt;\/td&gt;<br \/>\n&lt;\/tr&gt;<br \/>\n&lt;\/table&gt;<br \/>\n&lt;script language=&quot;JavaScript&quot;&gt;<br \/>\nfunction BYMarquee(){<br \/>\nthis.Content = []; \/\/\u663e\u793a\u5185\u5bb9<br \/>\nthis.Speed = 20; \/\/\u4e0a\u79fb\u901f\u5ea6<br \/>\nthis.Object = {}; \/\/marquee\u5bb9\u5668\u5bf9\u8c61<br \/>\nthis.Pause = true; \/\/\u662f\u5426\u505c\u7559<br \/>\nthis.Start = function(){<br \/>\nvar o = this.Object;<br \/>\nvar Pause = this.Pause;<br \/>\nvar Stop = false;<br \/>\nvar Stop2 = false;<br \/>\no.onmouseover = function(){<br \/>\nStop = Stop2 = true;<br \/>\n}<br \/>\no.onmouseout = function(){<br \/>\nStop = Stop2 = false;<br \/>\n}<br \/>\nvar BodyHtml = [];<br \/>\nfor(var i in this.Content){<br \/>\nBodyHtml.push(&quot;&lt;a href=\\&quot;&quot; + this.Content[i].link + &quot;\\&quot;&gt;&quot; + this.Content[i].text + &quot;&lt;\/a&gt;&quot;);<br \/>\n}<br \/>\nvar Dv = document.createElement(&quot;div&quot;);<br \/>\nDv.innerHTML = BodyHtml.join(&quot;&lt;br \/&gt;&quot;);<br \/>\no.appendChild(Dv);<br \/>\nvar DvHeight = Dv.offsetHeight;<br \/>\nwhile(Dv.offsetHeight \/ 2 &lt; o.offsetHeight){<br \/>\nDv.innerHTML += &quot;&lt;br \/&gt;&quot; + Dv.innerHTML;<br \/>\n}<br \/>\nDv.innerHTML += &quot;&lt;br \/&gt;&quot; + Dv.innerHTML;<br \/>\nsetInterval(function(){<br \/>\nif(!Stop){<br \/>\no.scrollTop ++;<br \/>\nif(o.scrollTop == o.scrollHeight &#8211; o.offsetHeight){<br \/>\no.scrollTop = DvHeight &#8211; o.offsetHeight;<br \/>\n}<br \/>\nif(Pause){<br \/>\nif(o.scrollTop % o.offsetHeight == 0){<br \/>\nStop = true;<br \/>\nsetTimeout(function(){<br \/>\nStop = Stop2;<br \/>\n}, 3000);<br \/>\n}<br \/>\n}<br \/>\n}<br \/>\n}, this.Speed);<br \/>\n}<br \/>\n}<br \/>\n\/\/\u5b9e\u4f8b1<br \/>\nvar marquee1 = new BYMarquee();<br \/>\nmarquee1.Content = [<br \/>\n{link : &#8216;#&#8217;, text : &#8216;\u82f1\u6cd5\u56fd\u9632\u90e8\u8bc1\u5b9e\u4e24\u56fd\u6838\u6f5c\u8247\u76f8\u649e&#8217;},<br \/>\n{link : &#8216;#&#8217;, text : &#8216;\u4e2d\u56fd\u8d74\u6b27\u91c7\u8d2d\u6e05\u5355\u6572\u5b9a \u6d89\u53ca\u91d1\u989d150\u4ebf\u5143&#8217;}<br \/>\n];<br \/>\nmarquee1.Object = document.getElementById(&#8216;marquee1&#8217;);<br \/>\nmarquee1.Start();<br \/>\n\/\/\u5b9e\u4f8b2<br \/>\nvar marquee2 = new BYMarquee();<br \/>\nmarquee2.Content = [<br \/>\n{link : &#8216;#&#8217;, text : &#8216;\u5251\u4ed9\u674e\u6a2a\u63e1\u950b\u5229\u56a3\u5f20\u7684\u5730\u94dc\u5251\uff0c\u5de6\u53f3\u6643\u52a8&#8217;},<br \/>\n{link : &#8216;#&#8217;, text : &#8216;\u4f60\u7684\u5974\u96b6\u3010\u5251\u4ed9\u674e\u3011\u594b\u8d77\u53cd\u6297\uff0c\u88ab\u4f60\u72e0\u72e0\u5730\u6559\u8bad\u4e86\u4e00\u987f\uff01&#8217;},<br \/>\n{link : &#8216;#&#8217;, text : &#8216;\u6211\u7684\u5974\u96b6 Su.\u65b0\u6b66\u5c06 \u5728\u5974\u96b6\u5e02\u573a\u8f93\u7ed9\u4e86 \u91d1\u5149\u707f\u70c2&#8217;}<br \/>\n];<br \/>\nmarquee2.Speed = 10;<br \/>\nmarquee2.Object = document.getElementById(&#8216;marquee2&#8217;);<br \/>\nmarquee2.Start();<br \/>\n\/\/\u5b9e\u4f8b3<br \/>\nvar marquee3 = new BYMarquee();<br \/>\nmarquee3.Content = [<br \/>\n{link : &#8216;#&#8217;, text : &#8216;\u5173\u4e8e\u5c01\u88c5\u7684\u65b9\u6cd5\u4e4b\u95f4\u8c03\u7528\u7684\u95ee\u9898\u6c42\u52a9&#8217;},<br \/>\n{link : &#8216;#&#8217;, text : &#8216;\u5982\u4f55\u7528Javascript\u6765\u5220\u9664\u6d4f\u89c8\u5668\u7684\u5386\u53f2\u8bb0\u5f55\uff1f&#8217;},<br \/>\n{link : &#8216;#&#8217;, text : &#8216;\u8bf7\u9ad8\u624b\u5e2e\u5fd9\u7834\u89e3\u4e00\u6bb5\u4ee3\u7801&#8217;}<br \/>\n];<br \/>\nmarquee3.Speed = 50;<br \/>\nmarquee3.Pause = false;<br \/>\nmarquee3.Object = document.getElementById(&#8216;marquee3&#8217;);<br \/>\nmarquee3.Start();<\/p>\n<p>\n&nbsp;<\/p>\n<p>\/\/\u9500\u6bc1<br \/>\nmarquee1 = marquee2 = marquee3 = null;<br \/>\n&lt;\/script&gt;<br \/>\n&lt;\/body&gt;<br \/>\n&lt;\/html&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt;!DOCTYPE html PUBLIC &quot;-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN&quot; &quot;http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"topic":[],"class_list":["post-671","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/comments?post=671"}],"version-history":[{"count":1,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/671\/revisions"}],"predecessor-version":[{"id":66533,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/671\/revisions\/66533"}],"wp:attachment":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/media?parent=671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/categories?post=671"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/tags?post=671"},{"taxonomy":"topic","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/topic?post=671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}