1
右から左にではなく、上から下にマーキーのスクロールを行いたいと思います。jquery marqueeスクロールを右から左の代わりに上から下へ
私はjqueryの.animateを使用していますが、私はそれはあなたがにそれを調整する必要が
jQuery(document).ready(function($) {
var marquee = function() {
var window_width = window.innerWidth;
var speed = 12 * window_width;
$('#marquee li:first').animate({left: '-980px'}, speed, 'linear', function() {
$(this).detach().appendTo('#marquee ul').css('', "100%");
marquee();
});
};
if ($("#marquee li").length > 1) {
marquee();
}
});
html,
body {
margin: 0;
padding: 0;
width: 100%;
}
#marquee {
background: #090;
font-family: Arial, Verdana, sans-serif;
color: #FFF;
font-size: 12px;
text-align: center;
font-weight: bold;
line-height: 20px;
width: 1035px;
}
#marquee ul {
width: 100%;
height: 20px;
position: relative;
overflow: hidden;
}
#marquee li {
width: 980px;
line-height: 20px;
height: 20px;
position: absolute;
top: 0;
left: 100%;
text-align: center;
list-style: none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="marquee">
\t <ul>
<li>test 1</li>
<li>test 2</li>
</ul>
</div>
私はそれが仕事をdoesntの複数の項目を追加したら、これは、1つのだけのアイテムのためではなく、動作します。 – gabehou