Skip to content

Instantly share code, notes, and snippets.

@toaotc
toaotc / jquery.scoreboard.js
Created August 16, 2011 09:29 — forked from anonymous/jquery.scoreboard.js
jQuery scoreboard plugin
(function($) {
$.fn.scoreboard = function(config) {
config = $.extend({}, $.fn.scoreboard.defaults, config);
config.chars = config.chars.split('');
var charcode_map = {};
$.each(config.chars, function(i, el) {
charcode_map[el] = i;
});
@toaotc
toaotc / jquery.src.js
Created August 16, 2011 09:23 — forked from anonymous/jquery.src.js
jQuery src loading plugin
(function($) {
$.fn.src = function(uri, callback) {
return this.each(function() {
var $this = $(this);
$this.attr('src', 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==');
$this.one('load', callback);
$this.attr('src', uri);
})
}
})(jQuery);