• Etiam imperdiet volutpat libero eu tristique. Aenean, rutrum felis in. Read more...
  • Curabitur porttitor ante eget hendrerit adipiscing. Maecenas at magna. Read more...
  • Praesent ornare nisl lorem, ut condimentum lectus gravida ut. Read more...
  • Nunc ultrices tortor eu massa placerat posuere. Vivamus viverra sagittis. Read more...
  • Morbi sodales tellus sit amet leo congue bibendum. Ut non mauris eu neque. Read more...
  • In pharetra suscipit orci sed viverra. Praesent at sollicitudin tortor, id. Read more...
  • Maecenas nec ligula sed est suscipit aliquet sed eget ipsum, suspendisse. Read more...
  • Onec bibendum consectetur diam, nec euismod urna venenatis eget.. Read more...


MULTILINES SIMPLE EXAMPLE

var nt_example1 = $('#nt-example1').newsTicker({
row_height: 80,
max_rows: 3,
duration: 4000,
prevButton: $('#nt-example1-prev'),
nextButton: $('#nt-example1-next')
});
  • 08:12 Etiam imperdiet volutpat libero eu tristique.
  • 08:41 Curabitur porttitor ante eget hendrerit adipi.
  • 10:02 Praesent ornare nisl lorem, ut condi.
  • 10:14 Nunc ultrices tortor eu massa placerat posuere.
  • 11:23 Morbi sodales tellus sit amet leo congue bibendum.
  • 11:45 In pharetra suscipit orci sed viverra. Praesent at.
  • 11:55 Maecenas nec ligula sed est suscipit aliquet sed.
  • 12:00 Onec bibendum consectetur diam, nec eui.
08:12
Cras sagittis nulla sit amet feugiat pulvinar. Fusce scelerisque aliquet purus, sit amet rutrum augue euismod ut. Aliquam erat volutpat. Integer convallis, ligula non bibendum dictum, ante lectus fringilla nunc, at euismod neque enim sit amet ante. In risus velit, porttitor blandit magna vel, adipiscing semper libero.

ONE LINE TICKER WITH CALLBACKS & METHODS EXAMPLE

var nt_example2 = $('#nt-example2').newsTicker({
row_height: 60,
max_rows: 1,
speed: 300,
duration: 6000,
prevButton: $('#nt-example2-prev'),
nextButton: $('#nt-example2-next'),
hasMoved: function() {
$('#nt-example2-infos-container').fadeOut(200, function(){
	$('#nt-example2-infos .infos-hour').text($('#nt-example2 li:first span').text());
	$('#nt-example2-infos .infos-text').text($('#nt-example2 li:first').data('infos'));
	$(this).fadeIn(400);
});
},
pause: function() {
$('#nt-example2 li i').removeClass('fa-play').addClass('fa-pause');
},
unpause: function() {
$('#nt-example2 li i').removeClass('fa-pause').addClass('fa-play');
}
});
$('#nt-example2-infos').hover(function() {
nt_example2.newsTicker('pause');
}, function() {
nt_example2.newsTicker('unpause');
});
  • Lorem
  • Ipsum
  • Praesent
  • Nunc
  • Morbi
  • Pharetra
  • Maecenas
  • Onec
START

BONUS : "ROULETTE" EXAMPLE, USING CALLBACKS & METHODS

var state = 'stopped';
var speed;
var add;
var nt_example3 = $('#nt-example3').newsTicker({
row_height: 80,
max_rows: 1,
duration: 0,
speed: 10,
autostart: 0,
pauseOnHover: 0,
hasMoved: function() {
if (speed > 700) {
	$('#nt-example3').newsTicker("stop");
	console.log('stop')
	$('#nt-example3-button').text("RESULT: " + $('#nt-example3 li:first').text().toUpperCase());
	setTimeout(function() {
		$('#nt-example3-button').text("START");
		state = 'stopped';
	},2500);
	
}
else if (state == 'stopping') {
	add = add * 1.4;
	speed = speed + add;
	console.log(speed)
	$('#nt-example3').newsTicker('updateOption', "duration", speed + 25);
	$('#nt-example3').newsTicker('updateOption', "speed", speed);
}
}
});
$('#nt-example3-button').click(function(){
if (state == 'stopped') {
state = 'turning';
speed = 1;
add = 1;
$('#nt-example3').newsTicker('updateOption', "duration", 0);
$('#nt-example3').newsTicker('updateOption', "speed", speed);
nt_example3.newsTicker('start');
$(this).text("STOP");
}
else if (state == 'turning') {
state = 'stopping';
$(this).text("WAITING...");
}
});

适用浏览器:360、FireFox、Chrome、Safari、Opera、傲游、搜狗、世界之窗. 不支持IE8及以下浏览器。

来源:我要特效