Created
November 11, 2018 15:21
-
-
Save faridv/03f964fe38ec7f1002fb78269868d10e to your computer and use it in GitHub Desktop.
Titles ticker plugin for jQuery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ticker Plugin | |
$.fn.fTicker = function (options) { | |
var $ticker = $(this); | |
var settings = $.extend({ | |
// defaults. | |
timeout: 5000 | |
}, options); | |
$.each($ticker, function () { | |
var $el = $(this).find("ul:first"); | |
if ($el.find("li").length < 2) | |
return false; | |
window.setInterval(function () { | |
$el.find('li:first').slideUp(function () { | |
$(this).appendTo($el).slideDown(); | |
}); | |
}, settings.timeout); | |
}); | |
return this; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment