CSS:
ul, li {Margin: 0; Polsterung: 0; } #scrolldiv {width: 300px; Höhe: 25px; Zeilenhöhe: 25px; Border-Bottom: #4c8cd1 1px Solid; Überlauf: versteckt; } #scrolldiv li {Höhe: 25px; Padding-Links: 10px; }JS:
<Script> Funktion autoscroll (obj) {$ (obj) .find ("ul: First"). Animate ({margintop: "-25px"}, 800, function () {$ (this) .css ({margintop: "0px"}). } $ (document) .ready (function () {setInterval ('autoscroll ("#scrolldiv")', 3000) setInterval ('autoscroll ("#scrolldiv")', 3000)}); </script>HTML:
<div id="scrollDiv"> <ul> <li>This is the first line of the announcement title</li> <li>This is the second line of the announcement title</li> <li>This is the third line of the announcement title</li> <li>This is the fourth line of the announcement title</li> <li>This is the fifth line of the announcement title</li> <li>This is the sixth line of the announcement Titel </li> <li> Dies ist die siebte Zeile des Ankündigungstitels </li> <li> Dies ist die achte Zeile des Ankündigungs -Titels </li> </ul> </div>
Die einfache Implementierung der obigen JS ununterbrochenen Scrollen ist der gesamte Inhalt, den ich mit Ihnen teile. Ich hoffe, Sie können Ihnen eine Referenz geben und ich hoffe, Sie können wulin.com mehr unterstützen.