{"id":184,"date":"2011-08-26T10:59:08","date_gmt":"2011-08-26T02:59:08","guid":{"rendered":""},"modified":"2022-10-16T11:29:25","modified_gmt":"2022-10-16T03:29:25","slug":"%e6%97%a0%e7%bc%9d%e6%bb%9a%e5%8a%a8%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"https:\/\/www.soulbox.cn\/?p=184","title":{"rendered":"\u65e0\u7f1d\u6eda\u52a8\u4ee3\u7801"},"content":{"rendered":"<p>JS\u4ee3\u7801\uff1a<\/p>\n<blockquote><p>&lt;script type=&quot;text\/javascript&quot;&gt;<\/p>\n<p>function Marquee()<br \/>{<br \/>this.ID = document.getElementById(arguments[0]);<br \/>if(!this.ID)<br \/>{<br \/>alert(&quot;\u60a8\u8981\u8bbe\u7f6e\u7684\\&quot;&quot; + arguments[0] + &quot;\\&quot;\u521d\u59cb\u5316\u9519\u8bef\\r\\n\u8bf7\u68c0\u67e5\u6807\u7b7eID\u8bbe\u7f6e\u662f\u5426\u6b63\u786e!&quot;);<br \/>this.ID = -1;<br \/>return;<br \/>}<br \/>this.Direction = this.Width = this.Height = this.DelayTime = this.WaitTime = this.CTL = this.StartID = this.Stop = this.MouseOver = 0;<br \/>this.Step = 1;<br \/>this.Timer = 30;<br \/>this.DirectionArray = {&quot;top&quot;:0 , &quot;up&quot;:0 , &quot;bottom&quot;:1 , &quot;down&quot;:1 , &quot;left&quot;:2 , &quot;right&quot;:3};<br \/>if(typeof arguments[1] == &quot;number&quot; || typeof arguments[1] == &quot;string&quot;)this.Direction = arguments[1];<br \/>if(typeof arguments[2] == &quot;number&quot;)this.Step = arguments[2];<br \/>if(typeof arguments[3] == &quot;number&quot;)this.Width = arguments[3];<br \/>if(typeof arguments[4] == &quot;number&quot;)this.Height = arguments[4];<br \/>if(typeof arguments[5] == &quot;number&quot;)this.Timer = arguments[5];<br \/>if(typeof arguments[6] == &quot;number&quot;)this.DelayTime = arguments[6];<br \/>if(typeof arguments[7] == &quot;number&quot;)this.WaitTime = arguments[7];<br \/>if(typeof arguments[8] == &quot;number&quot;)this.ScrollStep = arguments[8];<br \/>this.ID.style.overflow = this.ID.style.overflowX = this.ID.style.overflowY = &quot;hidden&quot;;<br \/>this.ID.noWrap = true;<br \/>this.IsNotOpera = (navigator.userAgent.toLowerCase().indexOf(&quot;opera&quot;) == -1);<br \/>if(arguments.length &gt;= 7)this.Start();<br \/>}<\/p>\n<p>Marquee.prototype.Start = function()<br \/>{<br \/>if(this.ID == -1)return;<br \/>if(this.WaitTime &lt; 800)this.WaitTime = 800;<br \/>if(this.Timer &lt; 20)this.Timer = 20;<br \/>if(this.Width == 0)this.Width = parseInt(this.ID.style.width);<br \/>if(this.Height == 0)this.Height = parseInt(this.ID.style.height);<br \/>if(typeof this.Direction == &quot;string&quot;)this.Direction = this.DirectionArray[this.Direction.toString().toLowerCase()];<br \/>this.HalfWidth = Math.round(this.Width \/ 2);<br \/>this.HalfHeight = Math.round(this.Height \/ 2);<br \/>this.BakStep = this.Step;<br \/>this.ID.style.width = this.Width + &quot;px&quot;;<br \/>this.ID.style.height = this.Height + &quot;px&quot;;<br \/>if(typeof this.ScrollStep != &quot;number&quot;)this.ScrollStep = this.Direction &gt; 1 ? this.Width : this.Height;<br \/>var templateLeft = &quot;&lt;table cellspacing=&#39;0&#39; cellpadding=&#39;0&#39; style=&#39;border-collapse:collapse;display:inline;&#39;&gt;&lt;tr&gt;&lt;td noWrap=true style=&#39;white-space: nowrap;word-break:keep-all;&#39;&gt;MSCLASS_TEMP_HTML&lt;\/td&gt;&lt;td noWrap=true style=&#39;white-space: nowrap;word-break:keep-all;&#39;&gt;MSCLASS_TEMP_HTML&lt;\/td&gt;&lt;\/tr&gt;&lt;\/table&gt;&quot;;<br \/>var templateTop = &quot;&lt;table cellspacing=&#39;0&#39; cellpadding=&#39;0&#39; style=&#39;border-collapse:collapse;&#39;&gt;&lt;tr&gt;&lt;td&gt;MSCLASS_TEMP_HTML&lt;\/td&gt;&lt;\/tr&gt;&lt;tr&gt;&lt;td&gt;MSCLASS_TEMP_HTML&lt;\/td&gt;&lt;\/tr&gt;&lt;\/table&gt;&quot;;<br \/>var msobj = this;<br \/>msobj.tempHTML = msobj.ID.innerHTML;<br \/>if(msobj.Direction &lt;= 1)<br \/>{<br \/>msobj.ID.innerHTML = templateTop.replace(\/MSCLASS_TEMP_HTML\/g,msobj.ID.innerHTML);<br \/>}<br \/>else<br \/>{<br \/>if(msobj.ScrollStep == 0 &#038;&#038; msobj.DelayTime == 0)<br \/>{<br \/>msobj.ID.innerHTML += msobj.ID.innerHTML;<br \/>}<br \/>else<br \/>{<br \/>msobj.ID.innerHTML = templateLeft.replace(\/MSCLASS_TEMP_HTML\/g,msobj.ID.innerHTML);<br \/>}<br \/>}<br \/>var timer = this.Timer;<br \/>var delaytime = this.DelayTime;<br \/>var waittime = this.WaitTime;<br \/>msobj.StartID = function(){msobj.Scroll()}<br \/>msobj.Continue = function()<br \/>{<br \/>if(msobj.MouseOver == 1)<br \/>{<br \/>setTimeout(msobj.Continue,delaytime);<br \/>}<br \/>else<br \/>{ clearInterval(msobj.TimerID);<br \/>msobj.CTL = msobj.Stop = 0;<br \/>msobj.TimerID = setInterval(msobj.StartID,timer);<br \/>}<br \/>}<\/p>\n<p>msobj.Pause = function()<br \/>{<br \/>msobj.Stop = 1;<br \/>clearInterval(msobj.TimerID);<br \/>setTimeout(msobj.Continue,delaytime);<br \/>}<\/p>\n<p>msobj.Begin = function()<br \/>{<br \/>msobj.ClientScroll = msobj.Direction &gt; 1 ? msobj.ID.scrollWidth \/ 2 : msobj.ID.scrollHeight \/ 2;<br \/>if((msobj.Direction &lt;= 1 &#038;&#038; msobj.ClientScroll &lt;= msobj.Height + msobj.Step) || (msobj.Direction &gt; 1 &#038;&#038; msobj.ClientScroll &lt;= msobj.Width + msobj.Step)) {<br \/>msobj.ID.innerHTML = msobj.tempHTML;<br \/>delete(msobj.tempHTML);<br \/>return;<br \/>}<br \/>delete(msobj.tempHTML);<br \/>msobj.TimerID = setInterval(msobj.StartID,timer);<br \/>if(msobj.ScrollStep &lt; 0)return;<br \/>msobj.ID.onmousemove = function(event)<br \/>{<br \/>if(msobj.ScrollStep == 0 &#038;&#038; msobj.Direction &gt; 1)<br \/>{<br \/>var event = event || window.event;<br \/>if(window.event)<br \/>{<br \/>if(msobj.IsNotOpera)<br \/>{<br \/>msobj.EventLeft = event.srcElement.id == msobj.ID.id ? event.offsetX &#8211; msobj.ID.scrollLeft : event.srcElement.offsetLeft &#8211; msobj.ID.scrollLeft + event.offsetX;<br \/>}<br \/>else<br \/>{<br \/>msobj.ScrollStep = null;<br \/>return;<br \/>}<br \/>}<br \/>else<br \/>{<br \/>msobj.EventLeft = event.layerX &#8211; msobj.ID.scrollLeft;<br \/>}<br \/>msobj.Direction = msobj.EventLeft &gt; msobj.HalfWidth ? 3 : 2;<br \/>msobj.AbsCenter = Math.abs(msobj.HalfWidth &#8211; msobj.EventLeft);<br \/>msobj.Step = Math.round(msobj.AbsCenter * (msobj.BakStep*2) \/ msobj.HalfWidth);<br \/>}<br \/>}<br \/>msobj.ID.onmouseover = function()<br \/>{<br \/>if(msobj.ScrollStep == 0)return;<br \/>msobj.MouseOver = 1;<br \/>clearInterval(msobj.TimerID);<br \/>}<br \/>msobj.ID.onmouseout = function()<br \/>{<br \/>if(msobj.ScrollStep == 0)<br \/>{<br \/>if(msobj.Step == 0)msobj.Step = 1;<br \/>return;<br \/>}<br \/>msobj.MouseOver = 0;<br \/>if(msobj.Stop == 0)<br \/>{<br \/>clearInterval(msobj.TimerID);<br \/>msobj.TimerID = setInterval(msobj.StartID,timer);<br \/>}<br \/>}<br \/>}<br \/>setTimeout(msobj.Begin,waittime);<br \/>}<\/p>\n<p>Marquee.prototype.Scroll = function()<br \/>{<br \/>switch(this.Direction)<br \/>{<br \/>case 0:<br \/>this.CTL += this.Step;<br \/>if(this.CTL &gt;= this.ScrollStep &#038;&#038; this.DelayTime &gt; 0)<br \/>{<br \/>this.ID.scrollTop += this.ScrollStep + this.Step &#8211; this.CTL;<br \/>this.Pause();<br \/>return;<br \/>}<br \/>else<br \/>{<br \/>if(this.ID.scrollTop &gt;= this.ClientScroll)<br \/>{<br \/>this.ID.scrollTop -= this.ClientScroll;<br \/>}<br \/>this.ID.scrollTop += this.Step;<br \/>}<br \/>break;<\/p>\n<p>case 1:<br \/>this.CTL += this.Step;<br \/>if(this.CTL &gt;= this.ScrollStep &#038;&#038; this.DelayTime &gt; 0)<br \/>{<br \/>this.ID.scrollTop -= this.ScrollStep + this.Step &#8211; this.CTL;<br \/>this.Pause();<br \/>return;<br \/>}<br \/>else<br \/>{<br \/>if(this.ID.scrollTop &lt;= 0)<br \/>{<br \/>this.ID.scrollTop += this.ClientScroll;<br \/>}<br \/>this.ID.scrollTop -= this.Step;<br \/>}<br \/>break;<\/p>\n<p>case 2:<br \/>this.CTL += this.Step;<br \/>if(this.CTL &gt;= this.ScrollStep &#038;&#038; this.DelayTime &gt; 0)<br \/>{<br \/>this.ID.scrollLeft += this.ScrollStep + this.Step &#8211; this.CTL;<br \/>this.Pause();<br \/>return;<br \/>}<br \/>else<br \/>{<br \/>if(this.ID.scrollLeft &gt;= this.ClientScroll)<br \/>{<br \/>this.ID.scrollLeft -= this.ClientScroll;<br \/>}<br \/>this.ID.scrollLeft += this.Step;<br \/>}<br \/>break;<\/p>\n<p>case 3:<br \/>this.CTL += this.Step;<br \/>if(this.CTL &gt;= this.ScrollStep &#038;&#038; this.DelayTime &gt; 0)<br \/>{<br \/>this.ID.scrollLeft -= this.ScrollStep + this.Step &#8211; this.CTL;<br \/>this.Pause();<br \/>return;<br \/>}<br \/>else<br \/>{<br \/>if(this.ID.scrollLeft &lt;= 0)<br \/>{<br \/>this.ID.scrollLeft += this.ClientScroll;<br \/>}<br \/>this.ID.scrollLeft -= this.Step;<br \/>}<br \/>break;<br \/>}<br \/>}<br \/>&lt;\/script&gt;<\/p><\/blockquote>\n<p>\u9875\u9762\u4ee3\u7801\uff1a<\/p>\n<blockquote><p>&lt;script type=&quot;text\/javascript&quot;&gt;new Marquee(&quot;Box5&quot;,2,1,846,234,null,0,1000,1);&lt;\/script&gt;<br \/>&lt;div id=&quot;Box5&quot; style=&quot;overflow:hidden;width:846px;float:left; height:234px;&quot;&gt;<br \/>&lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;&lt;tr&gt;<br \/>&lt;td&gt;&lt;img src=&quot;images\/pro\/01.jpg&quot; height=&quot;234&quot; style=&quot;margin-left:6px;&quot;\/&gt;&lt;\/td&gt;<br \/>&lt;td&gt;&lt;img src=&quot;images\/pro\/02.jpg&quot; height=&quot;234&quot; style=&quot;margin-left:6px;&quot;\/&gt;&lt;\/td&gt;<br \/>&lt;td&gt;&lt;img src=&quot;images\/pro\/03.jpg&quot; height=&quot;234&quot; style=&quot;margin-left:6px;&quot;\/&gt;&lt;\/td&gt;<br \/>&lt;td&gt;&lt;img src=&quot;images\/pro\/04.jpg&quot; height=&quot;234&quot; style=&quot;margin-left:6px;&quot;\/&gt;&lt;\/td&gt;<br \/>&lt;td&gt;&lt;img src=&quot;images\/pro\/05.jpg&quot; height=&quot;234&quot; style=&quot;margin-left:6px;&quot;\/&gt;&lt;\/td&gt;<br \/>&lt;td&gt;&lt;img src=&quot;images\/pro\/06.jpg&quot; height=&quot;234&quot; style=&quot;margin-left:6px;&quot;\/&gt;&lt;\/td&gt;<br \/>&lt;td&gt;&lt;img src=&quot;images\/pro\/07.jpg&quot; height=&quot;234&quot; style=&quot;margin-left:6px;&quot;\/&gt;&lt;\/td&gt;<br \/>&lt;td&gt;&lt;img src=&quot;images\/pro\/08.jpg&quot; height=&quot;234&quot; style=&quot;margin-left:6px;&quot;\/&gt;&lt;\/td&gt;<br \/>&lt;td&gt;&lt;img src=&quot;images\/pro\/09.jpg&quot; height=&quot;234&quot; style=&quot;margin-left:6px;&quot;\/&gt;&lt;\/td&gt;<br \/>&lt;td&gt;&lt;img src=&quot;images\/pro\/10.jpg&quot; height=&quot;234&quot; style=&quot;margin-left:6px;&quot;\/&gt;&lt;\/td&gt;&lt;\/tr&gt;&lt;\/table&gt;<br \/>&lt;\/div&gt;<\/p><\/blockquote>\n<p>\u53c2\u6570\u8bf4\u660e\uff1a<br \/>ID &quot;marquee&quot; \u5bb9\u5668ID (\u5fc5\u9009)<br \/>Direction (0) \u6eda\u52a8\u65b9\u5411 (\u53ef\u9009,\u9ed8\u8ba4\u4e3a0\u5411\u4e0a\u6eda\u52a8) \u53ef\u8bbe\u7f6e\u7684\u503c\u5305\u62ec:0,1,2,3,&quot;top&quot;,&quot;bottom&quot;,&quot;left&quot;,&quot;right&quot; (0\u5411\u4e0a 1\u5411\u4e0b 2\u5411\u5de6 3\u5411\u53f3)<br \/>Step (1) \u6eda\u52a8\u7684\u6b65\u957f (\u53ef\u9009,\u9ed8\u8ba4\u503c\u4e3a2,\u6570\u503c\u8d8a\u5927,\u6eda\u52a8\u8d8a\u5feb)<br \/>Width (760) \u5bb9\u5668\u53ef\u89c6\u5bbd\u5ea6 (\u53ef\u9009,\u9ed8\u8ba4\u503c\u4e3a\u5bb9\u5668\u521d\u59cb\u8bbe\u7f6e\u7684\u5bbd\u5ea6)<br \/>Height (52) \u5bb9\u5668\u53ef\u89c6\u9ad8\u5ea6 (\u53ef\u9009,\u9ed8\u8ba4\u503c\u4e3a\u5bb9\u5668\u521d\u59cb\u8bbe\u7f6e\u7684\u9ad8\u5ea6)<br \/>Timer (50) \u5b9a\u65f6\u5668 (\u53ef\u9009,\u9ed8\u8ba4\u503c\u4e3a30,\u6570\u503c\u8d8a\u5c0f,\u6eda\u52a8\u7684\u901f\u5ea6\u8d8a\u5feb,1000=1\u79d2,\u5efa\u8bae\u4e0d\u5c0f\u4e8e20)<br \/>DelayTime (5000) \u95f4\u6b47\u505c\u987f\u5ef6\u8fdf\u65f6\u95f4(\u53ef\u9009,\u9ed8\u8ba4\u4e3a0\u4e0d\u505c\u987f,1000=1\u79d2)<br \/>WaitTime (3000) \u5f00\u59cb\u65f6\u7684\u7b49\u5f85\u65f6\u95f4(\u53ef\u9009,\u9ed8\u8ba4\u62160\u4e3a\u4e0d\u7b49\u5f85,1000=1\u79d2)<br \/>ScrollStep (52) \u95f4\u6b47\u6eda\u52a8\u95f4\u8ddd (\u53ef\u9009,\u9ed8\u8ba4\u4e3a\u7ffb\u5c4f\u5bbd\/\u9ad8\u5ea6,\u8be5\u6570\u503c\u4e0e\u5ef6\u8fdf\u5747\u4e3a0\u5219\u4e3a\u9f20\u6807\u60ac\u505c\u63a7\u5236,-1\u7981\u6b62\u9f20\u6807\u63a7\u5236)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>JS\u4ee3\u7801\uff1a &lt;script&#46;&#46;&#46;<\/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":[6],"class_list":["post-184","post","type-post","status-publish","format-standard","hentry","category-web","tag-web"],"_links":{"self":[{"href":"https:\/\/www.soulbox.cn\/index.php?rest_route=\/wp\/v2\/posts\/184","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.soulbox.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.soulbox.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.soulbox.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.soulbox.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=184"}],"version-history":[{"count":1,"href":"https:\/\/www.soulbox.cn\/index.php?rest_route=\/wp\/v2\/posts\/184\/revisions"}],"predecessor-version":[{"id":807,"href":"https:\/\/www.soulbox.cn\/index.php?rest_route=\/wp\/v2\/posts\/184\/revisions\/807"}],"wp:attachment":[{"href":"https:\/\/www.soulbox.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.soulbox.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.soulbox.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}