JavaScript Document
var Marquee = {
Arridobj: {/*marqueebox: {distance:-95,//move distance delay:3000,//delay time speed:1000//move time},mincount:2*/},
Creating objects
Startmarquee:function () {
assigning values to parameters
if (this.arridobj! = null && typeof This.arridobj = = = = "Object") {
For (var p in this.arridobj) {
var obj = new Classmarquee (document.getElementById (P), this.arridobj[p]);
}
}else{return null;}
function Classmarquee (objelem,params) {
var $objElem = $ (Objelem);
var mparams = params;
At least a few.
if (Params.mincount > $ (Objelem). Children (). length) {return null;}
Initialization
var T;
var B = false;
$objElem. MouseOver (function () {b = true;});
$objElem. Mouseout (function () {b = false;});
function Start () {
$objElem. CSS ("margin-top", "0");
t = setTimeout (Scrolling,mparams.delay);
}
function scrolling () {
if (!b) {
var styleval = mparams.distance + "px";
$objElem. Animate ({"Margin-top": Styleval},mparams.speed, "linear", function () {
$objElem. Append ($objElem. Children () [0]);
Start ();
});
}else{
Start ();
}
}
Start ();
}
}
}
Custom section
Marquee.arridobj ={
Marqueebox: {
distance:-95,//Moving Distance
delay:3000,//Delay Time
speed:1000,//Move Time
Mincount:5
},
marqueebox1:{
distance:-121,//Moving Distance
delay:3000,//Delay Time
speed:1000,//Move Time
Mincount:2
}
}
Marquee.startmarquee ();
<ul id= "Marqueebox" ><li></li><li></li><li></li><li></li> <li></li></ul>
<ul id= "Marqueebox1" ><li></li><li></li><li></li></ul>
JQ Automatic sliding rotation (insert small pieces backwards)