New Javacript rolling
Javascript rolling the new law, I think we all have seen a variety of rolling (the most common is to use the information to update above), under normal circumstances as long as the picture is not all use the HTML itself provides a very good marker rolling — to complete the marquee (JS can be used to achieve this same effect); course is not to say that the picture can not do that.
Following is the marquee of some of the basic parameters:
The labeling format syntax is as follows:
<Marquee
Aligh left = | center | right | top | bottom
Bgcolor = # n
Direction = left | right | up | down
= Type behavior
Height = n
Hspace = n
Scrollamount = n
Scrolldelay = n
Width = n
VSpace = n
Loop = n> content </ marquee>
Below explain the meaning of each parameter:
Align: setting activities is the location of subtitles, in addition to the Habitat left, center, right of abode in three locations, increased by (top) and on the next (bottom) two positions.
Bgcolor: subtitles activities set for the background color, you can use the English word can also be hexadecimal numbers.
Direction: for setting activities subtitles rolling direction is the left (left), right (right), up (up), down (down).
Behavior: rolling for the setting, mainly by three ways:
Behavior = "scroll" said rolling from one end to another end;
Behavior = "slide": that rapid sliding from one end to another end, and will not repeat;
Behavior = "alternate" that roll back and forth between the two ends.
Height: rolling subtitles for the set height.
Width: the width of the set rolling subtitles.
Hspace and vspace: the subtitles for the set rolling around the rim and the width of upper and lower borders.
Scrollamount: for setting activities subtitles rolling distance. Numerical smaller, the speed of the rolling sooner.
Scrolldelay: set rolling for the delay time between the two, the smaller the value, the smaller the interval.
Loop: set for the number of rolling, when the loop =- 1 that has been rolling on, until the updated pages. Which by default is unlimited rolling left and the caption text is a high degree of height rolling: horizontal scrolling the width is the width of the current position; vertical scrolling is the height of the height of the current location.
Now is to introduce a new type of rolling, JS use of the method to do subtitles rolling: progressive, in the middle 1-2 second pause (such as classical):
The following code will be posted to the location you want to show that we can:
<script>
Var marqueeContent = new Array () / / definition of an array, used to store display
MarqueeContent [0] = '<A href="#" onclick="reinitMarquee()"> refresh latest list of </ FONT> </ A>';
MarqueeContent [1] = '<a href=http://www.blueidea.com/updatelist.asp target=_blank> site updated 60 </ a>';
MarqueeContent [2] = '<A href=http://www.blueidea.com/tech/graph/2003/875.asp target=_blank> feather effect produced Directory </ a>';
MarqueeContent [3] = '<A href=http://www.blueidea.com/tech/program/2003/831.asp target=_blank> MySQL & ASP </ a>';
MarqueeContent [4] = '<A href=http://www.blueidea.com/tech/web/2003/874.asp target=_blank> preliminary understanding CSS3 </ a>';
MarqueeContent [5] = '<A href=http://www.blueidea.com/tech/graph/2003/864.asp target=_blank> Fireworks MX 2004 version of the implementation of Operation </ a>';
MarqueeContent [6] = '<A href=http://www.blueidea.com/tech/graph/2003/872.asp target=_blank> Fireworks MX 2004 Contour fountain fills </ a>';
MarqueeContent [7] = '<A href=http://www.blueidea.com/photo/gallery/2003/873.asp target=_blank> bottle flower </ a>';
MarqueeContent [8] = '<A href=http://www.blueidea.com/tech/graph/2003/871.asp target=_blank> Fireworks MX achieve tabbed effect </ a>';
MarqueeContent [9] = '<A href=http://www.blueidea.com/photo/gallery/2003/870.asp target=_blank> Couples: black-and-white love air </ a>';
MarqueeContent [10] = '<A href=http://www.blueidea.com/tech/graph/2003/866.asp target=_blank> production MAC style Apple logo </ a>';
MarqueeContent [11] = '<A href=http://www.blueidea.com/tech/graph/2003/868.asp target=_blank> Pokeerchu eggshell production and the figure of </ a>';
Var marqueeInterval = new Array () / / definition of a number of common and frequently used variables
Var marqueeId = 0;
Var marqueeDelay = 4000;
Var marqueeHeight = 16;
/ / Followed by the definition of some of the functions to be used to
Array.prototype.random = function () (
Var a = this;
Var l = a.length;
For (var i = 0; i <l; i + +) (
Var r = Math.floor (Math.random () * (li));
A.slice a = (0, r). Concat (a.slice (r +1)). Concat (a [r]);
)
Return a;
)
Function initMarquee () (
MarqueeContent = marqueeContent.random ();
Var str ='';
For (var i = 0; i <Math.min(3,marqueeContent.length);i++) str+=(i> 0? '':'')+ MarqueeContent [i];
Document.write ( '<div id = marqueeBox style = "overflow: hidden; height:' + marqueeHeight + 'px" onmouseover = "clearInterval (marqueeInterval [0])" onmouseout = "marqueeInterval [0] = setInterval (\' startMarquee ( ) \ 'marqueeDelay) "> <div>' + str + '</ div> </ div>');
MarqueeId + = 2;
If (marqueeContent.length> 3) marqueeInterval [0] = setInterval ( "startMarquee ()", marqueeDelay);
)
Function reinitMarquee () (
Js_scroll_content.src = 'scroll_content2.js';
MarqueeContent = marqueeContent.random ();
Var str ='';
For (var i = 0; i <Math.min(3,marqueeContent.length);i++) str+=(i> 0? '':'')+ MarqueeContent [i];
MarqueeBox.childNodes [(marqueeBox.childNodes.length == 1? 1-0)]. InnerHTML = str;
MarqueeId = 2;
)
Function startMarquee () (
Var str ='';
For (var i = 0; (i <3) & (marqueeId + i <marqueeContent.length) i + +) (
Str + = (i> 0? '':'')+ MarqueeContent [marqueeId + i];
)
MarqueeId + = 3;
If (marqueeId> marqueeContent.length) marqueeId = 0;
If (marqueeBox.childNodes.length == 1) (
Var nextLine = document.createElement ( 'DIV');
NextLine.innerHTML = str;
MarqueeBox.appendChild (nextLine);
)
Else (
MarqueeBox.childNodes [0]. InnerHTML = str;
MarqueeBox.appendChild (marqueeBox.childNodes [0]);
MarqueeBox.scrollTop = 0;
)
ClearInterval (marqueeInterval [1]);
MarqueeInterval [1] = setInterval ( "scrollMarquee ()", 20);
)
Function scrollMarquee () (
MarqueeBox.scrollTop + +;
If (marqueeBox.scrollTop% marqueeHeight == (marqueeHeight-1)) (
ClearInterval (marqueeInterval [1]);
)
)
InitMarquee ();
</ Script>
Above this site has been the practice of rolling done a rough introduction. Posted on 2004-12-10 11:39 day that love of reading (196) Comments (0) edit collections cited






