PATH:
home
/
letacommog
/
letaweb
/
scripts
/
libraries
/* Vertical News Ticker 1.15 Original by: Tadas Juozapaitis ( kasp3rito [eta] gmail (dot) com ) http://www.jugbit.com/jquery-vticker-vertical-news-ticker/ Forked/Modified by: Richard Hollis @richhollis - richhollis.co.uk*/(function($){ var defaults = { speed: 700, pause: 4000, showItems: 1, mousePause: true, height: 0, animate: true, margin: 0, padding: 0, startPaused: false }; var internal = { moveUp: function(state, attribs) { internal.animate(state, attribs, 'up'); }, moveDown: function(state, attribs){ internal.animate(state, attribs, 'down'); }, animate: function(state, attribs, dir) { var height = state.itemHeight; var options = state.options; var el = state.element; var obj = el.children('ul'); state.topIndex = state.topIndex || 0; var selector = (dir === 'up') ? 'li:first' : 'li:last'; el.trigger("vticker.beforeTick"); var clone = obj.children(selector).clone(true); if(options.height > 0) height = obj.children('li:first').height(); height += (options.margin) + (options.padding*2); // adjust for margins & padding if(dir==='down') obj.css('top', '-' + height + 'px').prepend(clone); if(attribs && attribs.animate) { if(state.animating) return; state.animating = true; var opts = (dir === 'up') ? {top: '-=' + height + 'px'} : {top: 0}; obj.animate(opts, options.speed, function() { $(obj).children(selector).remove(); $(obj).css('top', '0px'); state.animating = false; el.trigger("vticker.afterTick"); }); } else { obj.children(selector).remove(); obj.css('top', '0px'); el.trigger("vticker.afterTick"); } dir== 'up' ? state.topIndex++ : state.topIndex--; if(dir==='up') clone.appendTo(obj); }, nextUsePause: function() { var state = $(this).data('state'); var options = state.options; if(state.isPaused || state.itemCount < 2) return; methods.next.call( this, {animate:options.animate} ); }, startInterval: function() { var state = $(this).data('state'); var options = state.options; var initThis = this; state.intervalId = setInterval(function(){ internal.nextUsePause.call( initThis ); }, options.pause); }, stopInterval: function() { var state = $(this).data('state'); if(!state) return; if(state.intervalId) clearInterval(state.intervalId); state.intervalId = undefined; }, restartInterval: function() { internal.stopInterval.call(this); internal.startInterval.call(this); } }; var methods = { init: function(options) { // if init called second time then stop first, then re-init methods.stop.call(this); // init var defaultsClone = jQuery.extend({}, defaults); var options = $.extend(defaultsClone, options); var el = $(this); var state = { topIndex: options.topIndex, itemCount: el.children('ul').children('li').length, itemHeight: 0, itemMargin: 0, element: el, animating: false, options: options, isPaused: (options.startPaused) ? true : false, pausedByCode: false }; $(this).data('state', state); el.css({overflow: 'hidden', position: 'relative'}) .children('ul').css({position: 'absolute', margin: 0, padding: 0}) .children('li').css({margin: options.margin, padding: options.padding}); if(isNaN(options.height) || options.height === 0) { el.children('ul').children('li').each(function(){ var current = $(this); if(current.height() > state.itemHeight) state.itemHeight = current.height(); }); // set the same height on all child elements el.children('ul').children('li').each(function(){ var current = $(this); current.height(state.itemHeight); }); // set element to total height var box = (options.margin) + (options.padding * 2); el.height(((state.itemHeight + box) * options.showItems) + options.margin); } else { // set the preferred height el.height(options.height); } var initThis = this; if(!options.startPaused) { internal.startInterval.call( initThis ); } if(options.mousePause) { el.bind("mouseenter", function () { //if the automatic scroll is paused, don't change that. if (state.isPaused === true) return; state.pausedByCode = true; // stop interval internal.stopInterval.call( initThis ); methods.pause.call( initThis, true ); }).bind("mouseleave", function () { //if the automatic scroll is paused, don't change that. if (state.isPaused === true && !state.pausedByCode) return; state.pausedByCode = false; methods.pause.call(initThis, false); // restart interval internal.startInterval.call( initThis ); }); } }, pause: function(pauseState) { var state = $(this).data('state'); if(!state) return undefined; if(state.itemCount < 2) return false; state.isPaused = pauseState; var el = state.element; if(pauseState) { $(this).addClass('paused'); el.trigger("vticker.pause"); } else { $(this).removeClass('paused'); el.trigger("vticker.resume"); } }, next: function(attribs) { var state = $(this).data('state'); if(!state) return undefined; if(state.animating || state.itemCount < 2) return false; internal.restartInterval.call( this ); internal.moveUp(state, attribs); }, prev: function(attribs) { var state = $(this).data('state'); if(!state) return undefined; if(state.animating || state.itemCount < 2) return false; internal.restartInterval.call( this ); internal.moveDown(state, attribs); }, stop: function() { var state = $(this).data('state'); if(!state) return undefined; internal.stopInterval.call( this ); }, remove: function() { var state = $(this).data('state'); if(!state) return undefined; internal.stopInterval.call( this ); var el = state.element; el.unbind(); el.remove(); } }; $.fn.vTicker = function( method ) { if ( methods[method] ) { return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 )); } else if ( typeof method === 'object' || ! method ) { return methods.init.apply( this, arguments ); } else { $.error( 'Method ' + method + ' does not exist on jQuery.vTicker' ); } };})(jQuery);
[+]
..
[+]
jQuery-Tags-Input
[-] countdown.js
[edit]
[-] owl.carousel.js
[edit]
[-] base.js
[edit]
[-] jquery.ui.core.js
[edit]
[+]
select2
[-] jquery.matchHeight-min.js
[edit]
[+]
master-slider
[-] jquery.metadata.js
[edit]
[+]
owl-carousel
[-] dataTables.columnFilter.js
[edit]
[-] codemirror.js
[edit]
[+]
jqvmap
[-] css.js
[edit]
[-] jquery.ui.button.js
[edit]
[-] jquery.vticker.min.js
[edit]
[-] jwplayer.js
[edit]
[-] masonry.pkgd.js
[edit]
[-] jquery.smartmenus.min - Copy.js
[edit]
[-] jquery.ui.widget.js
[edit]
[-] jquery.ba-resize.min.js
[edit]
[-] jquery-ui-timepicker.js
[edit]
[-] jquery-migrate.js
[edit]
[-] jquery.nearest.min.js
[edit]
[-] swfobject.js
[edit]
[-] javascript.js
[edit]
[-] jquery.validate.password.js
[edit]
[-] jquery.colorbox.js
[edit]
[-] flexigrid.js
[edit]
[-] jquery.smartmenus.min.js
[edit]
[-] jcarousellite.js
[edit]
[+]
ckeditor_standard
[-] twig.min.js
[edit]
[-] superfish.js
[edit]
[-] bootstrap.min - Copy.js
[edit]
[-] jquery.dataTables.min.js
[edit]
[-] mustache.js
[edit]
[-] spectrum.js
[edit]
[-] jquery.ui.droppable.js
[edit]
[-] jquery.isotope.js
[edit]
[-] jquery.ui.slider.js
[edit]
[-] htmlmixed.js
[edit]
[-] jquery.tinycarousel.min.js
[edit]
[-] jquery.ui.sortable.js
[edit]
[-] jquery.hover.js
[edit]
[-] wow.min.js
[edit]
[-] jquery.fittext.js
[edit]
[+]
jquery.validate
[-] jquery.ui.draggable.js
[edit]
[-] jquery.ui.resizable.js
[edit]
[-] audio.min.js
[edit]
[+]
angular
[+]
less
[-] masonry.pkgd.min.js
[edit]
[+]
plupload
[-] jquery.rd-parallax.js
[edit]
[-] tabs.js
[edit]
[-] responsive.js
[edit]
[-] xml.js
[edit]
[-] expressInstall.swf
[edit]
[-] camera.js
[edit]
[-] pace.min.js
[edit]
[-] typed.js
[edit]
[-] jquery.nivo.slider.js
[edit]
[+]
bootstrap
[-] qtip.js
[edit]
[+]
mediaelement
[-] jquery.ui.mouse.js
[edit]
[+]
slick
[-] countUp.js
[edit]
[-] jquery.prettyPhoto.js
[edit]
[+]
ckeditor_full
[-] jquery.ui.spinner.js
[edit]
[-] portfolio-layout-plugin.js
[edit]
[-] require.js
[edit]
[-] nicEdit.js
[edit]
[-] jquery.json-2.4.min.js
[edit]
[-] jquery.ba-resize.js
[edit]
[-] jquery.mobilemenu.js
[edit]
[+]
nivo_slider
[+]
ui-iconpicker
[-] cloud-zoom.js
[edit]
[-] jquery.ui.datepicker.js
[edit]
[-] jquery.cycle.all.js
[edit]
[-] jquery.validate.js
[edit]
[+]
flot
[+]
jquery-ui
[-] jquery.cleditor.min.js
[edit]
[-] jquery.easing.js
[edit]
[-] jquery.elevateZoom.min.js
[edit]
[-] bootstrap.min.js
[edit]
[-] jquery.bxslider.js
[edit]
[-] mediaelement-and-player.min.js
[edit]
[-] jquery.zoom-min.js
[edit]
[-] jquery.nearest.js
[edit]
[-] jquery.autosize.js
[edit]