JQ Automatic sliding rotation (insert small pieces backwards)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.