User talk:Jinbobo

Template:G/Tank
There needs to be made one change to the base math (I had that same error in my old code, so no error on your side). Change needs to be done in the MediaWiki:common.js, for which I don't have editing rights:

Old Code: /** Clip tank image **/ $(".tankClip").each(function{	usage = $(this).children(".Tank-usage").html;	max = $(this).children(".Tank-max").html;	addtop = $(this).children(".Tank-add-top").html;	clipbottom = $(this).children(".Tank-bottom").html;	if(max == 0) max = 10000;	height = $(this).find("img").height;	width = $(this).find("img").width;	cliptop = (height/2*(1-usage/max))*2+addtop;	cliptop = Math.round(cliptop*100)/100;	$(this).css("clip","rect("+String(cliptop)+"px auto "+clipbottom+" auto)"); }); New Code: (change only regarding the cliptop= lines) /** Clip tank image **/ $(".tankClip").each(function{	usage = $(this).children(".Tank-usage").html;	max = $(this).children(".Tank-max").html;	addtop = $(this).children(".Tank-add-top").html;	clipbottom = $(this).children(".Tank-bottom").html;	if(max == 0) max = 10000;	height = $(this).find("img").height;	width = $(this).find("img").width;	cliptop = (ceil(height/2*(1-usage/max)))*2+addtop;	$(this).css("clip","rect("+String(cliptop)+"px auto "+clipbottom+" auto)"); });

The image override I should test (if you mean something like 10000 instead of 10000 ) works perfectly.

Other strange stuff I found: Some values for usage seem to bring very wrong results. usage = 1000 and 6000 for example result in no display. If I view the html sourcecode, cliptop seems to be too big by a factor of 10. But only for some of those values. --MilConDoin (talk) 11:40, 4 August 2013 (BST)