This article mainly introduces the js text effects of horizontal scrolling, the implementation process is very simple, text in a certain area of horizontal scrolling without gap, interested friends can refer to this article to share the js text horizontal scrolling special effect code. The specific implementation content is as follows:
Page Layout
Congratulations, 793765 *** received 50 yuan mega node card reward congratulations, 793765 *** received 50 yuan mega node card reward congratulations, 793765 *** received 50 yuan mega node card reward congratulations, 793765 *** received 50 yuan giant node card reward congratulations 793765 *** get 50 yuan giant node card reward congratulations 793765 *** get 50 yuan giant node card reward congratulations 793765 *** get 50 yuan giant node card reward
Style:
.pad_right{ padding-right:2em;}#scroll_p {height:26px;overflow: hidden;white-space: nowrap;width:535px;margin-left:10px;}#scroll_begin,#scroll_end {display: inline;}
Js Code:
// Function ScrollImgLeft () {var speed = 50; var MyMar = null; var scroll_begin = document. getElementById ("scroll_begin"); var scroll_end = document. getElementById ("scroll_end"); var scroll_p = document. getElementById ("scroll_p"); functions = functions Marquee () {if (scroll_end.offsetWidth-scroll_p.scrollLeft <= 0) scroll_p.scrollLeft-= rows; else scroll_p.scrollLeft ++;} MyMar = setInterval (Marquee, speed); scroll_p.onmouseover = function () {clearInterval (MyMar);} scroll_p.onmouseout = function () {MyMar = setInterval (Marquee, speed);} ScrollImgLeft ();
The above shows how to easily implement the js text lateral scrolling effect. You can add the js text lateral scrolling effect to Your webpage.