Difference between revisions of "User:Svip/monobook.js"
Jump to navigation
Jump to search
m (Unfortunately, I still need a way to obtain the current amount. :S) |
m |
||
Line 8: | Line 8: | ||
var currentAmount = 10; | var currentAmount = 10; | ||
var nowWidth = (currentAmount/topAmount)*barWidth; | var nowWidth = (currentAmount/topAmount)*barWidth; | ||
number.innerHTML = | number.innerHTML = currentAmount; | ||
bar.style.width = nowWidth + "px"; | bar.style.width = nowWidth + "px"; | ||
} | } | ||
addOnloadHook(updateDonationNotice); | addOnloadHook(updateDonationNotice); |
Revision as of 20:27, 20 April 2009
function updateDonationNotice() { if(!document.getElementById("donation-progress-number")) return; var number = document.getElementById("donation-progress-number"); var bar = document.getElementById("donation-progress-indicator"); var barWidth = 200; var topAmount = 500; var currentAmount = 10; var nowWidth = (currentAmount/topAmount)*barWidth; number.innerHTML = currentAmount; bar.style.width = nowWidth + "px"; } addOnloadHook(updateDonationNotice);