/* A Javascript widget to all the links on the current page.
* Requested by Jeremy Malcom to accompany blog with vid 115563.
*/
(function ($) {
'use strict';
$(function () {
var linkCount = 0;
$('a').each(function () {
if ($(this).attr('href') && $(this).attr('href') !== '#') {
linkCount++;
}
});
var countHTML = '
' +
'0
';
$('#countdiv').append(countHTML);
$('#countdiv').fadeIn('slow');
$({countNum: $('#linkcount').text()}).animate({countNum: linkCount}, {
duration: 8000,
easing: 'linear',
step: function () {
$('#linkcount').text(Math.floor(this.countNum));
},
complete: function () {
$('#linkcount').text(this.countNum);
}
});
});
})(jQuery);