├── .gitignore ├── README ├── images ├── controls.png ├── dl-arr.png ├── down-arr.gif ├── forkme.png └── main-red-bg.gif ├── includes ├── jquery.ticker.js └── site.js ├── index.html └── styles ├── font ├── League_Gothic-webfont.eot ├── League_Gothic-webfont.svg ├── League_Gothic-webfont.ttf └── League_Gothic-webfont.woff ├── style.css └── ticker-style.css /.gitignore: -------------------------------------------------------------------------------- 1 | Capfile 2 | config/* 3 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | jQuery News Ticker 2 | ----------------------------------- 3 | 4 | An easy to use, slick and flexible news ticker in the style of the BBC News page ticker (http://news.bbc.co.uk). 5 | 6 | Recommended for jQuery 1.4.x or above only (A very early version with support for with jQuery 1.3.2 is available from the website, but is missing some features and is no longer supported). 7 | 8 | Please visit http://www.jquerynewsticker.com/ for full documentation and downloads. 9 | 10 | ----------------------------------- 11 | 12 | Released under GPL v2 - read more here: http://www.gnu.org/licenses/gpl-2.0.html 13 | 14 | Copyright 2011 Rhodri George 15 | -------------------------------------------------------------------------------- /images/controls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhodimus/jQuery-News-Ticker/cc23fd516713f640bdc0d535a0e951b9ceebe068/images/controls.png -------------------------------------------------------------------------------- /images/dl-arr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhodimus/jQuery-News-Ticker/cc23fd516713f640bdc0d535a0e951b9ceebe068/images/dl-arr.png -------------------------------------------------------------------------------- /images/down-arr.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhodimus/jQuery-News-Ticker/cc23fd516713f640bdc0d535a0e951b9ceebe068/images/down-arr.gif -------------------------------------------------------------------------------- /images/forkme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhodimus/jQuery-News-Ticker/cc23fd516713f640bdc0d535a0e951b9ceebe068/images/forkme.png -------------------------------------------------------------------------------- /images/main-red-bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhodimus/jQuery-News-Ticker/cc23fd516713f640bdc0d535a0e951b9ceebe068/images/main-red-bg.gif -------------------------------------------------------------------------------- /includes/jquery.ticker.js: -------------------------------------------------------------------------------- 1 | /* 2 | jQuery News Ticker is free software: you can redistribute it and/or modify 3 | it under the terms of the GNU General Public License as published by 4 | the Free Software Foundation, version 2 of the License. 5 | 6 | jQuery News Ticker is distributed in the hope that it will be useful, 7 | but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | GNU General Public License for more details. 10 | 11 | You should have received a copy of the GNU General Public License 12 | along with jQuery News Ticker. If not, see . 13 | */ 14 | (function($){ 15 | $.fn.ticker = function(options) { 16 | // Extend our default options with those provided. 17 | // Note that the first arg to extend is an empty object - 18 | // this is to keep from overriding our "defaults" object. 19 | var opts = $.extend({}, $.fn.ticker.defaults, options); 20 | 21 | // check that the passed element is actually in the DOM 22 | if ($(this).length == 0) { 23 | if (window.console && window.console.log) { 24 | window.console.log('Element does not exist in DOM!'); 25 | } 26 | else { 27 | alert('Element does not exist in DOM!'); 28 | } 29 | return false; 30 | } 31 | 32 | /* Get the id of the UL to get our news content from */ 33 | var newsID = '#' + $(this).attr('id'); 34 | 35 | /* Get the tag type - we will check this later to makde sure it is a UL tag */ 36 | var tagType = $(this).get(0).tagName; 37 | 38 | return this.each(function() { 39 | // get a unique id for this ticker 40 | var uniqID = getUniqID(); 41 | 42 | /* Internal vars */ 43 | var settings = { 44 | position: 0, 45 | time: 0, 46 | distance: 0, 47 | newsArr: {}, 48 | play: true, 49 | paused: false, 50 | contentLoaded: false, 51 | dom: { 52 | contentID: '#ticker-content-' + uniqID, 53 | titleID: '#ticker-title-' + uniqID, 54 | titleElem: '#ticker-title-' + uniqID + ' SPAN', 55 | tickerID : '#ticker-' + uniqID, 56 | wrapperID: '#ticker-wrapper-' + uniqID, 57 | revealID: '#ticker-swipe-' + uniqID, 58 | revealElem: '#ticker-swipe-' + uniqID + ' SPAN', 59 | controlsID: '#ticker-controls-' + uniqID, 60 | prevID: '#prev-' + uniqID, 61 | nextID: '#next-' + uniqID, 62 | playPauseID: '#play-pause-' + uniqID 63 | } 64 | }; 65 | 66 | // if we are not using a UL, display an error message and stop any further execution 67 | if (tagType != 'UL' && tagType != 'OL' && opts.htmlFeed === true) { 68 | debugError('Cannot use <' + tagType.toLowerCase() + '> type of element for this plugin - must of type