Signin  Pricing  Examples  Support

Libraries > jquery.ticker.js

jquery.ticker.js - Search Live Website Code
It's like doing CTRL+F on millions of websites' source code



NerdyData is a search engine for source code. Search the source code of 200 million websites.


JAVASCRIPT FILE http://ianshindi.com/js/jquery.ticker.js

Function Explorer











Libraries on ianshindi.com


allslideshow.js

crawler.js

fadeslideshow.js

jquery.colorbox.js

jquery.easing.min.js

jquery.min.js

jquery.ticker.js

scrolltopcontrol.js

slide.js

mootools.js

swfobject.js

videobox.js



Explore More


analytics.js

head.load-1.0.3.min.js

ie-lt-8.js

bvapi.js

jquery.ticker.js
				
(function(a){a.fn.ticker=function(c){var e=a.extend({},a.fn.ticker.defaults,c);var b="#"+a(this).attr("id");var d=a(this).attr("tagName");return this.each(function(){var j={position:0,time:0,distance:0,newsArr:{},play:true,paused:false,contentLoaded:false,dom:{contentID:"#ticker-content",titleID:"#ticker-title",titleElem:"#ticker-title SPAN",tickerID:"#ticker",wrapperID:"#ticker-wrapper",revealID:"#ticker-swipe",revealElem:"#ticker-swipe SPAN",controlsID:"#ticker-controls",prevID:"#prev",nextID:"#next",playPauseID:"#play-pause"}};if(d!="UL"&&e.htmlFeed===true){o("Cannot use <"+d.toLowerCase()+"> type of element for this plugin - must of type <ul>");return false}f();function l(r){var q=0,p;for(p in r){if(r.hasOwnProperty(p)){q++}}return q}function o(p){if(e.debugMode){if(window.console&&window.console.log){window.console.log(p)}else{alert(p)}}}function f(){a(j.dom.wrapperID).append('<div id="'+j.dom.tickerID.replace("#","")+'"><div id="'+j.dom.titleID.replace("#","")+'"><span style="display: none;"><!-- --></span></div><p id="'+j.dom.contentID.replace("#","")+'"></p><div id="'+j.dom.revealID.replace("#","")+'"><span style="display: none;"><!-- --></span></div></div>');a(j.dom.wrapperID).removeClass("no-js").addClass("has-js");a(j.dom.tickerElem+","+j.dom.titleElem+","+j.dom.contentID).hide();if(e.controls){a(j.dom.controlsID).live("click mouseover mousedown mouseout mouseup",function(q){var p=q.target.id;if(q.type=="click"){switch(p){case j.dom.prevID.replace("#",""):j.paused=true;a(j.dom.playPauseID).addClass("paused");g(p);break;case j.dom.nextID.replace("#",""):j.paused=true;a(j.dom.playPauseID).addClass("paused");g(p);break;case j.dom.playPauseID.replace("#",""):if(j.play==true){j.paused=true;a(j.dom.playPauseID).addClass("paused");m()}else{j.paused=false;a(j.dom.playPauseID).removeClass("paused");n()}break}}else{if(q.type=="mouseover"&&a("#"+p).hasClass("controls")){a("#"+p).addClass("over")}else{if(q.type=="mousedown"&&a("#"+p).hasClass("controls")){a("#"+p).addClass("down")}else{if(q.type=="mouseup"&&a("#"+p).hasClass("controls")){a("#"+p).removeClass("down")}else{if(q.type=="mouseout"&&a("#"+p).hasClass("controls")){a("#"+p).removeClass("over")}}}}}});a(j.dom.wrapperID).append('<ul id="'+j.dom.controlsID.replace("#","")+'"><li id="'+j.dom.playPauseID.replace("#","")+'" class="controls"></li><li id="'+j.dom.prevID.replace("#","")+'" class="controls"></li><li id="'+j.dom.nextID.replace("#","")+'" class="controls"></li></ul>')}a(j.dom.contentID).mouseover(function(){if(j.paused==false){m()}}).mouseout(function(){if(j.paused==false){n()}});h()}function h(){if(j.contentLoaded==false){if(e.ajaxFeed){o("Code Me!")}else{if(e.htmlFeed){if(a(b+" LI").length>0){a(b+" LI").each(function(p){j.newsArr["item-"+p]={type:e.titleText,content:a(this).html()}})}else{o("Couldn't find any content for the ticker to use!");return false}}else{o("Couldn't find any content for the ticker to use!");return false}}j.contentLoaded=true}a(j.dom.titleElem).html(j.newsArr["item-"+j.position].type);a(j.dom.contentID).html(j.newsArr["item-"+j.position].content);if(j.position==(l(j.newsArr)-1)){j.position=0}else{j.position++}distance=a(j.dom.contentID).width();time=distance/e.speed;a(j.dom.wrapperID).find(j.dom.titleID).fadeIn().end().find(j.dom.titleElem).fadeIn("slow",i)}function i(){if(j.play){var p=a(j.dom.titleElem).width()+0;a(j.dom.revealID).css("left",p+"px");if(e.displayType=="fade"){a(j.dom.revealID).hide(0,function(){a(j.dom.contentID).css("left",p+"px").delay(20).fadeIn("slow",k)})}else{if(e.displayType=="scroll"){}else{a(j.dom.revealElem).show(0,function(){a(j.dom.contentID).css("left",p+"px").show();a(j.dom.revealID).css("margin-left","0px").delay(20).animate({marginLeft:distance+"px"},time,"linear",k)})}}}else{return false}}function k(){if(j.play){a(j.dom.contentID).delay(e.pauseOnItems).fadeOut("slow");if(e.displayType=="fade"){a(j.dom.contentID).fadeOut(e.fadeOutSpeed,function(){a(j.dom.wrapperID).find(j.dom.revealElem+","+j.dom.contentID).hide().end().find(j.dom.tickerID+","+j.dom.revealID+","+j.dom.titleID).show().end().find(j.dom.tickerID+","+j.dom.revealID+","+j.dom.titleID).removeAttr("style");h()})}else{a(j.dom.revealID).hide(0,function(){a(j.dom.tickerID).delay(e.pauseOnItems).fadeOut(e.fadeOutSpeed,function(){a(j.dom.wrapperID).find(j.dom.titleElem+","+j.dom.revealElem+","+j.dom.contentID).hide().end().find(j.dom.tickerID+","+j.dom.revealID+","+j.dom.titleID).show().end().find(j.dom.tickerID+","+j.dom.revealID+","+j.dom.titleID).removeAttr("style");h()})})}}else{a(j.dom.revealElem).hide()}}function m(){j.play=false;a(j.dom.tickerID+","+j.dom.revealID+","+j.dom.titleID+","+j.dom.titleElem+","+j.dom.revealElem+","+j.dom.contentID).stop(true,true);a(j.dom.revealID+","+j.dom.revealElem).hide();a(j.dom.wrapperID).find(j.dom.titleID+","+j.dom.titleElem).show().end().find(j.dom.contentID).show()}function n(){j.play=true;j.paused=false;k()}function g(p){m();switch(p){case"prev":if(j.position==0){j.position=l(j.newsArr)-2}else{if(j.position==1){j.position=l(j.newsArr)-1}else{j.position=j.position-2}}a(j.dom.titleElem).html(j.newsArr["item-"+j.position].type);a(j.dom.contentID).html(j.newsArr["item-"+j.position].content);break;case"next":a(j.dom.titleElem).html(j.newsArr["item-"+j.position].type);a(j.dom.contentID).html(j.newsArr["item-"+j.position].content);break}if(j.position==(l(j.newsArr)-1)){j.position=0}else{j.position++}}})};a.fn.ticker.defaults={speed:0.1,ajaxFeed:false,displayType:"reveal",htmlFeed:true,debugMode:true,controls:true,pauseOnItems:3000,fadeInSpeed:300,fadeOutSpeed:300}})(jQuery);


A B C D E F G H I J K L M N O P Q R S T U V W X Y Z