Jsp:
The following is the control scrolling style, the scrolling content query out, put in a div or other container, I use the <dt>
<style>
#newCglist {Width:300px;height:14px;line-height:14px;overflow:hidden}
#newCglist li{height:14px;padding-left:10px;}
</style>
The following is a container for scrolling content display
<dt class= "Positionrel" id= "newcglist" ><div class= "New Positionabs" ></div></dt>
The following is JS, query scrolling display content
var divhight; //This is the height of all data rows, the row height per row * Data volume
var showtimes; //Displays the time of all data, each line shows the time required * Data volume
Function Yejis () {
setinterval (' AutoScroll ("#newCglist") ', $);
//latest deal case show
$.post ("Zraction!newcglist.action", null,function (data) {
divhight = data.length*14;
showtimes = data.length*3000;
$.each (data,function (i,datas) {
$ul = $ ("<ul></ul>");
$TR = $ ("<li>" +datas[0]+ "signed successfully! " +datas[1]+ "Yuan " +datas[2]+ " " +datas[3]+ "</li>");
$ul. Append ($TR);
$ ("#newCglist"). Append ($ul);
});
});
Here are the controls for scrolling display time, as well as styling
/**
* Page top scrolling effect, divhight is the row height of all data
* Showtimes //time required to cycle through this data
* @param {Object} obj
* @memberOf {TypeName}
*/
function AutoScroll (obj) {
$ (obj). Find ("Ul:first"). Animate ({
Margintop:-divhight
},showtimes,function () {
$ (this). CSS ({margintop: "0px"}). Find ("Li:first"). AppendTo (this);
});
}