View Full Version : Need help to lock a counter size!
MADrigal
08-22-2004, 11:56 PM
Hi,
I've got a problem common to all the counters in my sites.
The counter is 100x26 pixels wide, so when the page is loaded, it appears correctly inside of a table around 150 pixels wide.
But the problem is that while it's loaded from the SC server, it takes MUCH more space on the page, because of its VERY LONG "alt" property, which shows "StatCounter - Free Web Tracker and Counter"
So while page loads, the layout appears distorted, since the "image" properties are "heavier" than the size setting of the cell where the counter is.
I tried to lock the counter size by using a
<div style="width: 100 px; height: 26 px">
---> COUNTER SCRIPT HERE
</div>
But this didn't work.
I guess is there a way to avoid the script to show the "alt" message, or is there a way to ACTUALLY lock the size of that image?
I don't want to be forced to use an "invisible" counter... :(
Hello Madrigal,
I've the same difficulty, but I resolved by putting the counter at end of
page in an added row with a good (ample) width. Even you may put a row where you "combine" the cells to make only one cell. Then you will
not see the visual bad effect.
Hope to be of help. Bye,
Lucy
MADrigal
08-23-2004, 10:45 AM
Unfortunately I can't do the same thing. :cry:
I believe there must be some trick... maybe by using an "iframe" ???
Well, surely here they will offer you some other solution. But it may be done also at the beginning of your site, i.e. with your "first" site:
1. the logo at middle cell of one row, as you have it
2. below, an added small row for the sentence "click on logo or here to enter" positioned at middle cell and centered.
3. the three cell row, at left the "ie gif", in middle cell the counter, at right cell the "best viewed with ...". At middle cell, you should put the counter numbers in a following "line", so you will see the upper writing or image (you are visitor nr), at next line the StatCounter numbers, and below the lower writing or image (since Nov 17th... )
4. remaining site as it is.
A further possibility would be to move the alignment of the counter middle cell to "left", not the same of course ....
good luck
lucy
p.s.: of course at my site I've put StatCounter at end of page, but added a 2nd. outstanding link to StatCounter at entering page with the sentence "Stats supported by StatCounter".
MADrigal
08-24-2004, 10:05 PM
Thanks much for yoour reply but... well you see... I don't use StatCounter on the site you mentionned! :wink:
The site where I need to lock the counter is private at this time, since it's not complete and it's on a secret subfolder on one of my sites.
I solved the problem by making it invisible (which is not enough to solve the problem of the "alt text width") and putting it between two large tables, this way:
<table width=760>
...
</table>
& nbsp ** COUNTER CODE HERE **
<table width=760>
...
</table>
At first I tried to put it at the end of the page, after the last </table>, but it caused an additional problem: even though the counter is invisible, it still takes some space. Since my site's layout needs to be attached to the top and bottom border of IExplore, I couldn't do that, hence I placed it in the only place where I had enough space (both horz and vert.), that's in between those tables.
Hey I discovered another problem but couldn't explain it. I installed Mozilla Firefox today and tested my new site, and even though the counter is set as "invisible", a writing appeared: "powered by StatCounter etc etc" (or similar) with a link to www.statcounter.com
I've been forced to remove the <noscript> tag from the StatCounter code, so the writing finally disappeared.
I wish I solved the whole problem.
And oh, in order to support SC, I placed a GIF in the place where teh counter should have appeared in the first place :)
PS: I don't receive any email notify from this forum and thread... don't understand...
webado
08-25-2004, 01:22 AM
It seems to me you're going about it the wrong way.
Kind of hard to figure out without seeing the source code though :?
There's no reason for the counter to occupy more than the size of the picture itself. The alt tag should not interfere, as that only appears when you hover over the image of the counter and it does not take space on the page. And if you make the counter invisible, it should not occupy any actual space- provided you've generated the fresh code to go with it. Remember the counter can be either always totally invisible from the main settings, or invisible through the option in Install Code.
I think you've probably put the counter inside the scope of some other tag that interferes with its rendering.
Of course your visible counter has a fixed size, as defined where you've configured it (number of digits, font style). You cannot change that pixel size (at least I don't think you can) on the web page. In that case, yes, it may push things out of kilter, if the space set aside for it is smaller than what it needs. But when it's invisible, it needs nothing at all.
I don't see how your 2 tables could work. Surely they are not side by side with the counter in between. For one thing their width of 760 pixels is too large to fit two of them across a screen, even at the highest resolution settings (unless maybe you have one of those wide-screen laptops and even then I'm not sure what the maximum would be).
If you need two tables with a counter in between, then define another table at a higher level and 3 <td> cells to accomodate your 2 tables. Leftmost <td> and rightmost <td> have the same width, say 45% each, which leaves the counter image with 10% of the space. Center the counter within it's cell.
Remember also that if you use CELLPADDING and CELLSPACING in your tables, that also uses up space that you may not have counted.
MADrigal
08-27-2004, 02:07 AM
There's no reason for the counter to occupy more than the size of the picture itself. The alt tag should not interfere, as that only appears when you hover over the image of the counter and it does not take space on the page. And if you make the counter invisible, it should not occupy any actual space- provided you've generated the fresh code to go with it. Remember the counter can be either always totally invisible from the main settings, or invisible through the option in Install Code.
I believe you didn't read my post carefully: I never said the "alt" text stands there forever, I said that IExplorer (and Firefox too) "prepare" the page in case the image couldn't be loaded, so they reserve some space (size of the space is the same as the alt text).
At the end of the page load routine, everything goes OK, but in the meanwhile, the whole page appears as "distorted".
This is caused by the fact that I placed the SC code inside of a "left menu" that's around 100 pixels wide, while the "alt" txt would occupy more than 250 pixels.
Last year, when SC was offline, I experienced lots of problems on some sits of mine. SC image couldn't be loaded due to SC server problems, and the "blank" image appeared on my site all the time, with the damned ALT text there, making the whole layout distorted.
I think you've probably put the counter inside the scope of some other tag that interferes with its rendering.
Not at all: the SC code was complete before the "< noscript >" removal. I tested and tested and tested it again, I even saved the original counter.js from SC to my local server, removed the ALT text and made more tests (and in fact it worked perfectly as for graphics but of course it didn't work as "statistics" since it wasn't connected to the SC server).
Of course your visible counter has a fixed size, as defined where you've configured it (number of digits, font style). You cannot change that pixel size (at least I don't think you can) on the web page. In that case, yes, it may push things out of kilter, if the space set aside for it is smaller than what it needs. But when it's invisible, it needs nothing at all.
I know what you're talking about but as I said, the problem appears while the counter is LOADING.
I don't see how your 2 tables could work. Surely they are not side by side with the counter in between. For one thing their width of 760 pixels is too large to fit two of them across a screen, even at the highest resolution settings (unless maybe you have one of those wide-screen laptops and even then I'm not sure what the maximum would be).
The two tables are one BELOW the other! The result of the
<table> blah blah </table>
&
<table> blah blah </table>
makes two table appearing one below the other, having a little space in between.
Thanks for yoru reply, but that didn't help at all, since your suggestion doesn't fit my needs. I strongly believe the SC code should be revised as for the ALT text.
MADrigal
08-27-2004, 02:11 AM
Chris,
if you want to understand what I speak about, visit this website of mine:
http://www.nzone.emuita.it/
and pay attention to the right column (low), where the SC counter appears.
Notice that while the page loads, that column is VERY wide, then as the SC image appears, the whole layout goes back to normality.
Well, that's the problem I mentionned. In this case I don't worry much about this, but as for the site I'm planning (the one I mentionned in my previous posts), it's been necessary to modify the counter code.
Greets from Italy. Tnx for your help.
webado
08-27-2004, 03:06 AM
LOL! I didn't understand your problem at all it seems. But hard to see without a concrete example.
Well, I am very used to pages looking weird until they finish loading, so that would not strike me as odd or annoying unless it took very long to load. Your page loads very fast so I had to try it a few times to actually see the effect. I suppose it depends on the connection speed. I wouldn't worry about it.
I'll give you a little hint that I'm sure Webmaster won't mind very much: You can rewrite the text in that alt tag to keep the meaning but fit your space. As a matter of fact, every time you generate the code you acquire another version of it anyway.
Yyou could also try to add width and height diemsnions to the Statcounter <img> tag if only to speed up loading and reserve the right amount of space for it. It may fix the alt problem as well. The width and height won't affect the actual width and height displayed sicne that seems to be overridden by the script that generates the image.
Or you may decide to place the counter in another area of the page where it doesn't affect anything in that way.
Ciao! :lol:
MADrigal
08-27-2004, 04:11 PM
I can't set the ALT property for the SC image since... since I don't have access to that property!
In order to make the stats work properly, all you can do is placing the original SC code, that's: <script src="http://statcounter.com/counter.js"> (or similar).
By executing teh counter.js, the ALT text is created, in the same manner as the width property.
The only way I could modify the ALT and width properties is getting the counter.js file, placing it on MY SITE's server and MODIFYING it.... but unfortunately, at that point the stats won't work anymore since the SC code MUST be executed from the SC site (read my previous post).
As for your second suggstion... that's what I've been forced to do: I placed the calls to the counter.js in the only "empty and wide" space on my website.
I wish the SC authors will read this thread and modify their code.
PS: I have ADSL and by theway, the loading time is important by the way. Even by loading my site from my Apache server (127.0.0.1), it ALWAYS require a couple of seconds before the SC image appears.
No matter how fast your connection is: the problem will be always there.
MADrigal
09-01-2004, 12:18 PM
How is it that no admin/moderator said their opinion about this thread? I believe it's an important topic... :?
webado
09-01-2004, 01:44 PM
I can't set the ALT property for the SC image since... since I don't have access to that property!
Of course you have access to that - it appears in the code you inserted on your page, that you picked up from Install Counter.
And it has not taken me anywhere close to 2 seconds to load your page. It's only a fraction of a second really.
However if it bothers you that the page wiggles a bit while it's loading, well, sorry to hear that. I happen not to consider that the least bit an issue. However if you do, you should specifically contact the webmaster by a private message or a support ticket and voice your complaint. Posts in the forum can easily be overlooked.
MADrigal
09-02-2004, 12:17 PM
I can't set the ALT property for the SC image since... since I don't have access to that property!
Of course you have access to that - it appears in the code you inserted on your page, that you picked up from Install Counter.
Are you sure of what you're speaking about???? The code which is executed from my page (and it's the standard SC code) is:
<script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js">
Or are you mentioning the madrigal.retrogames.com or www.madrigal.emuita.it site? I don't use StatCounter there...
And it has not taken me anywhere close to 2 seconds to load your page. It's only a fraction of a second really.
Oh yes, on my site: www.gwmania.nzone.it it's just a while... but as I said I'm using that counter in a much larger site, and since IExplorer first downloads the layout, and the counter is loaded at the end, but it's inside of a larger table, the problem appears in that it loads the entire page in around 5 seconds (and I have 640 KBit ADSL), that's too much.
However if it bothers you that the page wiggles a bit while it's loading, well, sorry to hear that. I happen not to consider that the least bit an issue. However if you do, you should specifically contact the webmaster by a private message or a support ticket and voice your complaint. Posts in the forum can easily be overlooked.
I already sent PM to 2 moderators and webmaster and got no reply...
webado
09-02-2004, 01:42 PM
Oh, I was referring to the alt tag apearing within the html portion of the counter. That is something you can modify.
I see what you meant about the other alt tag. Sorry, not always on the same wave length :lol:
Now, since you want to use the invisible counter in fact, you could just configure that one instead of the button support one.
If you want to show your support for Statcounter, you could place the button separately as:
<img ="http://www.statcounter.com/images/counters/small_ad.gif"> (http://www.statcounter.com)
and that would result in:
http://www.statcounter.com/images/counters/small_ad.gif (www.statcounter.com)
MADrigal
09-02-2004, 11:02 PM
Would you ever figure that: even by using the invisible counter, the problem is there too!!! I personally tried last week (I already wrote it above on this thread) and discovered that the browser *always* reserves space for that ALT tag, even though the image has 0x0 size.
Btw we shouldn't feel astonished at this behaviour: if you read the content of the counter.js script, you'll discover that the image is *always* created, and then resized at 0x0, but while it's loading, the ALT text is there, or at least the browser reserves the space for it in case the image isn't loaded.
I already put the invisible counter in a "large" row of the site, plus I added a Statcounter credit on the left menu. That's the best I could do, even though it didn't fully solve the problem (even by using the invisible counter on an empty row it causes the row to be large and then thin all of a sudden)
vBulletin® v3.8.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.