Font size changer

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
Probocop
Forum Members
Forum Members
Posts: 12
Joined: Fri Apr 11, 2008 8:32 am

Font size changer

Post by Probocop »

Is there some sort of font size changer I can use with CMSMS?

I set up a Javascript font size changer that uses cookies to save the font size between pages.  This works fine for all the pages on the default template, but when I click a link to a page using a different template it doesn't save the font size.

Is it that the cookies arent working on different templates or something?
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: Font size changer

Post by Nullig »

Did you put the javascript into the head section of the other template?

Nullig
Probocop
Forum Members
Forum Members
Posts: 12
Joined: Fri Apr 11, 2008 8:32 am

Re: Font size changer

Post by Probocop »

All the javascript appears to be in place.  Once I'm at the page I've just clicked the link to, I can change the font size, but it will only stay that size between pages on the default template for some reason.

The website is: http://www.bettersight.co.uk
KO
Power Poster
Power Poster
Posts: 562
Joined: Mon Nov 06, 2006 7:55 pm

Re: Font size changer

Post by KO »

It might have something to do that you do not have that onload thingy in .

i'm not an javascript expert but you could try also adding:

window.onload = setDefaultFontSize();

on your javascript file. then you could remove whatever is in frontpage tag. Or adding whatever is in there to other templates. Othervise js is not executed on page load.
Probocop
Forum Members
Forum Members
Posts: 12
Joined: Fri Apr 11, 2008 8:32 am

Re: Font size changer

Post by Probocop »

Thank you!
I had completely forgotten about the body onload thing, these sort of problems always have the most obvious things causing them.

All working now.  :)
Post Reply

Return to “The Lounge”