This question is answered.


Permlink Replies: 6 - Pages: 1 - Last Post: 6 Jan 22, 10:59 Last Post By: M-i-c-h-a
M-i-c-h-a

Posts: 114
Registered: 7-Nov-2021
Wish: visit counter minimized per default
Posted: 5 Jan 22, 13:33
 
  Click to reply to this thread Reply
Hi,

at the moment I'm working on wild bee image library and I setup an own counter, but this counter is not working at all browsers so I tried the counter widget. I don't like the always floating black bar of the counter. Could it be possible to start the counter minimized please?

-Micha

https://www.apidarium.de
JeffTucker

Posts: 8,441
Registered: 31-Jan-2006
Re: Wish: visit counter minimized per default
Posted: 5 Jan 22, 13:36   in response to: M-i-c-h-a in response to: M-i-c-h-a
Helpful
  Click to reply to this thread Reply
If you want to track visitors, use Google Analytics. Your visitors don't need to see the count (why would they care?), and the widget visit counter doesn't filter out visits by search bots, and by you (you can tell Google Analytics what your IP address is, so it won't count your visits to your own site), so it's not very useful.
RobM

Posts: 4,377
Registered: 4-Aug-2006
Re: Wish: visit counter minimized per default
Posted: 5 Jan 22, 22:49   in response to: M-i-c-h-a in response to: M-i-c-h-a
 
  Click to reply to this thread Reply
For skins that let you add custom code, like Tiger, you can hide the widget bar and have it revealed using keys. I don't think it would hide widgets on mobile devices though, you would probably need to use a gesture code block. But analytics is probably best, unless you want a really simple counter.

For example in Tiger > Settings > Custom code > Head
Add
<script>
document.onkeydown = function(event) {
	switch(event.key) {
		case 'h':
			document.getElementById('jalbumwidgetcontainer').style.bottom='-30px';
			break;
		case 'w':
			document.getElementById('jalbumwidgetcontainer').style.bottom='0px';
			break;
	}
};
</script>

Switch to the 'Body' tab and enter
<script>
document.getElementById('jalbumwidgetcontainer').style.bottom='-30px';
</script>


Build and upload the album. When you visit the album the widgets will be off screen, use the 'w' key to show them and the 'h' key to hide them again. Obviously, this technique will hide all of the widgets, a user would not know they existed.
RobM

Posts: 4,377
Registered: 4-Aug-2006
Re: Wish: visit counter minimized per default
Posted: 6 Jan 22, 00:26   in response to: RobM in response to: RobM
Correct
  Click to reply to this thread Reply
The code to have the widget bar minimised, just showing the '+' at the bottom right is entered just in the 'Body' tag and is
<script>
document.getElementById('jalbum-widgetbar').style.display='none';
document.getElementById('jalbum-widgethandle').style.display='block';
</script>


Sample album, will be removed later, https://robm.jalbum.net/Sample%20Portfolio/
M-i-c-h-a

Posts: 114
Registered: 7-Nov-2021
Re: Wish: visit counter minimized per default
Posted: 6 Jan 22, 07:56   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Hi Rob,

thank you for the quick answer and the scripts. :)

I add the last script to my page but it doesn't work (also at your example page). If the page is opened a first time the counter is visible. Only if I minimize it and open the page again later, than it is minimized.

-Micha
RobM

Posts: 4,377
Registered: 4-Aug-2006
Re: Wish: visit counter minimized per default
Posted: 6 Jan 22, 10:35   in response to: M-i-c-h-a in response to: M-i-c-h-a
 
  Click to reply to this thread Reply
M-i-c-h-a wrote:
Hi Rob,

thank you for the quick answer and the scripts. :)

I add the last script to my page but it doesn't work (also at your example page). If the page is opened a first time the counter is visible. Only if I minimize it and open the page again later, than it is minimized.

-Micha

Sorry, I tried it on my desktop last night and it worked but this morning it isn’t working on my iPad.
M-i-c-h-a

Posts: 114
Registered: 7-Nov-2021
Re: Wish: visit counter minimized per default
Posted: 6 Jan 22, 10:46   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
No problem. I setup your w/h button script now and it works perfect. So I can quick check the counter. :)

Thanks,
Micha
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums