Font resizer
4 posters
Page 1 of 1
Font resizer
Is there a way to add a font resizer to the forum, much like the one on the admin page, which lets users resize the page font to their liking.
Re: Font resizer
Yes this can be done
Please add this to the following settings
JavaScript
Name it Font post resizer
All pages.
to change the font size just change the parts that say
any problems give me a shout. the tool will come up on the top right hand side of the first post.
Ape
Please add this to the following settings
JavaScript
Name it Font post resizer
All pages.
- Code:
//Quick Post font size toggle for forumotion boards
var pfsize = new Array('12px', '14px', '16px', '24px');
var plheight = new Array('14px', '16px', '18px', '24px');
var pfon = my_getcookie('fontsize');
if (pfon == null) {
pfon = '1';
my_setcookie('fontsize',pfon,true);
}
pfon = parseInt(pfon);
function setfontsize(startup) {
if (!startup) {
pfon++;
my_setcookie('fontsize',pfon.toString(),true);
}
if (pfon == pfsize.length) {pfon = 0;}
var fsize = pfsize[pfon];
var lheight = plheight[pfon];
$('.content.clearfix').css({fontSize:fsize,lineHeight:lheight});
}
$(function() {
if ($('.addthis_button')[0]) {
$('.addthis_button').eq(0).before('<button class="button2" title="Toggle font size in posts" onclick="setfontsize()"><img src="http://2img.net/i/fa/wysiwyg/style.png" /></button> • ');
setfontsize('x');
}
});
to change the font size just change the parts that say
- Code:
var plheight = new Array('14px', '16px', '18px', '24px');
any problems give me a shout. the tool will come up on the top right hand side of the first post.
Ape
Last edited by APE on July 20th 2014, 1:30 am; edited 2 times in total
Re: Font resizer
Updated my old post please read the topicmeemo wrote:Ok thanks, that would be greatly appreciated.
Re: Font resizer
It worked for the first couple of clicks then stopped. I deleted then reinstalled it and cleared my cache. Is there anyway to use it on all pages if I can get it to work again.
Re: Font resizer
Did you check the in all pages box?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Font resizer
So there is not a image next to the topic action and share links?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Font resizer
Yes, the grow/shrink font is there. It worked at first, then after a couple of clicks it stopped altogether.
Last edited by meemo on July 21st 2014, 1:40 am; edited 1 time in total
Re: Font resizer
I believe I know where that code comes from. There should also be a code to keep cookies.
http://www.dion-designs.com/area51/viewtopic.php?p=10986
http://www.dion-designs.com/area51/viewtopic.php?p=10986
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Font resizer
I opened up a different browser and it worked there, but it will only show up on forum pages. Is there anyway to get the default resizer that is in phpbb header. It's in the html code I believe.
Re: Font resizer
Well, a font resizer will only be for posts. So you want one for everything on your forum?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Font resizer
Yes, I've seen it function on other phpbb sites. It lives in the static header. Much like the one in the admin header.
Re: Font resizer
Is this what you're looking for? http://www.avacweb.com/t590-user-controled-text-size-zoom?highlight=size
Derri- Helper
- Posts : 8755
Reputation : 638
Language : English & Basic French
Location : Scotland, United Kingdom
Re: Font resizer
This probably exactly what I need but I don't know how to edit the themes' html to put it where I want on the page according to this part.
And then this HTML where you would like the font increaser to go:
<div id="LGfontsize">
Font Size:
<span onclick="change_font_size(true)"> <img src="IMAGE FOR DECREASING FONT SIZE"> </span>
<span onclick="change_font_size()"> <img src="IMAGE FOR INCREASING FONT SIZE"> </span>
</div>
And then this HTML where you would like the font increaser to go:
<div id="LGfontsize">
Font Size:
<span onclick="change_font_size(true)"> <img src="IMAGE FOR DECREASING FONT SIZE"> </span>
<span onclick="change_font_size()"> <img src="IMAGE FOR INCREASING FONT SIZE"> </span>
</div>
Re: Font resizer
Hi,
Go to Admin Control Panel --> Modules --> HTML and Javascript Codes Management --> HTML Pages Management --> Create New, then I think you simply paste the code --> Save
Go to Admin Control Panel --> Modules --> HTML and Javascript Codes Management --> HTML Pages Management --> Create New, then I think you simply paste the code --> Save
Derri- Helper
- Posts : 8755
Reputation : 638
Language : English & Basic French
Location : Scotland, United Kingdom
Re: Font resizer
But where would it go. Putting that code in doesn't tell the button where to go. I need to place it in the html code where I want it to show up, right? So I need to know where the theme html is.
Re: Font resizer
meemo wrote:But where would it go. Putting that code in doesn't tell the button where to go. I need to place it in the html code where I want it to show up, right? So I need to know where the theme html is.
It'll appear on the forum, I believe it appears in the header. This is how FM works. I believe you also need two images, one to control zoom and one to increase it.
Derri- Helper
- Posts : 8755
Reputation : 638
Language : English & Basic French
Location : Scotland, United Kingdom
Re: Font resizer
Putting it the html pages just adds an additional html page to the website, it does nothing in the theme/skin part like the instructions call for. Can forumotion not put on in the header just like in the admin page header?
Re: Font resizer
Can you not add this code to the Site description ?
- Code:
<div id=LGfontsize> Font Size: <span onclick=change_font_size(true)> <img src=IMAGE FOR DECREASING FONT SIZE> </span> <span onclick=change_font_size()> <img src=IMAGE FOR INCREASING FONT SIZE> </span>
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum