Language: JavaScript
Jquery Teletype Image Plugin
1: //*************************************** 2: // Description: Display images in a simple teletype style. 3: // Usage: $(".teletype").teletype({speed: 100}); 4: // Put all images in wrapper <div> 5: // e.g : <div class="teletype"><img src="/images/1.jpg" alt="" width="10" height="10"/> ... </div> 6: // Ensure the images are hidden 7: // e.g : .teletype img { display: none } 8: // Params example: ({speed:100},{type:"fast"}); 9: // Written by: Arran Maclean , A R Media Ltd. 22/03/2010 10: //*************************************** 11: ;(function($){ 12: $.fn.teletype = function(params) { 13: 14: params = $.extend( 15: {speed: 100}, 16: {type: ''}, 17: params); // capture speed or use default 18: 19: return this.each(function() { 20: 21: var ming = $("img",this); 22: var count = (ming.length); 23: var c = 0; 24: to = setInterval(function (){ 25: $(ming[c]).show(params.type); 26: c++ 27: if (c >= count){ 28: clearInterval(to); 29: } 30: }, params.speed); //end interval 31: 32: });// end return each 33: 34: }; // end type 35: })(jQuery);
Tags:
Description:
Display images wrapped with in target div one after another. Teletype.
Report Abuse
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search

