The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 26 posts ] 
Author Message
 Post subject: Font Smaller or Bigger
PostPosted: Mon Sep 05, 2005 4:32 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Sun Aug 28, 2005 7:03 pm
Posts: 156
Location: Montréal, Canada
Hey,

I was just reading some stuff on joomla.org and I stumbled on a cool feature of the template, the [ A+] [ A-] and [Reset] Buttons, does anyone know how to do that? If so can you be kind enough to enlighten me?  ;D

Thx, Serial

_________________
"The trick to creativity is knowing how to hide your sources..." Albert Einstein


Top
 Profile  
 
PostPosted: Mon Sep 05, 2005 4:54 pm 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Wed Aug 24, 2005 5:48 pm
Posts: 351
Location: Berlin
They use JavaScript functions for this feature:
A+
A-
Reset
In fact on joomla.org images are used for the "buttons".

_________________
RG
Torlaune.de - Fußball Videos Blog
SEO-Expert-Blog.com - SEO, Development, Internet Marketing


Top
 Profile  
 
PostPosted: Mon Sep 05, 2005 5:04 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Sun Aug 28, 2005 7:03 pm
Posts: 156
Location: Montréal, Canada
Thx  ;D

_________________
"The trick to creativity is knowing how to hide your sources..." Albert Einstein


Top
 Profile  
 
PostPosted: Tue Sep 20, 2005 4:39 pm 
Joomla! Intern
Joomla! Intern

Joined: Thu Aug 18, 2005 9:33 am
Posts: 65
Location: Netherlands
rg wrote:
They use JavaScript functions for this feature:
A+
A-
Reset
In fact on joomla.org images are used for the "buttons".


And how can we use buttons within this code? Just made above links the link of the buttons?


Top
 Profile  
 
PostPosted: Tue Sep 20, 2005 4:45 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Mon Aug 29, 2005 10:17 am
Posts: 13981
Location: Netherlands/ UK/ S'pore/Jakarta/ North America
Jelte wrote:
rg wrote:
They use JavaScript functions for this feature:
A+
A-
Reset
In fact on joomla.org images are used for the "buttons".


And how can we use buttons within this code? Just made above links the link of the buttons?


view page source :)

_________________
-- Joomla Professional Support Services : http://gws-desk.com --
-- Good & Cheap Joomla Sites Ready To Roll : http://gws-deals.today --
-- Joomla Specialized Hosting Solutions : www.gws-host.com --
-- Member Joomla Bug Squad --


Top
 Profile  
 
PostPosted: Tue Sep 20, 2005 4:46 pm 
User avatar
Joomla! Intern
Joomla! Intern

Joined: Thu Aug 18, 2005 10:18 pm
Posts: 72
http://www.lingo4u.de/article/fontsize/ you can use PHP and Cookies too for this effect :)


Top
 Profile  
 
PostPosted: Tue Sep 20, 2005 4:49 pm 
Joomla! Intern
Joomla! Intern

Joined: Thu Aug 18, 2005 9:33 am
Posts: 65
Location: Netherlands
Quote:
view page source :)


Found it:

Code:
<div id="css_buttons">
<a href="index.php" title="Increase size" onclick="changeFontSize(1);return false;"><img src="http://forum.joomla.org/Themes/joomla/images/jos_css_larger.png" border="0" alt="larger" /></a><a href="index.php" title="Decrease size" onclick="changeFontSize(-1);return false;"><img src="http://forum.joomla.org/Themes/joomla/images/jos_css_smaller.png" border="0" alt="smaller" /></a><a href="index.php" title="Revert styles to default" onclick="revertStyles(); return false;"><img src="http://forum.joomla.org/Themes/joomla/images/jos_css_reset.png" border="0" alt="reset" /></a>
</div>


Thanks :)


Top
 Profile  
 
PostPosted: Tue Sep 20, 2005 7:11 pm 
Joomla! Intern
Joomla! Intern

Joined: Thu Aug 18, 2005 9:33 am
Posts: 65
Location: Netherlands
I've added the code to my website but nothing happends... I think I need to put some javascript code in the heading of my page... don't I?

If so, what code should be inserted there?


Top
 Profile  
 
PostPosted: Wed Sep 21, 2005 1:15 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Sep 20, 2005 11:57 pm
Posts: 6
I'm trying to get this to work too...
I've deciphered some of it in the usual longhand way but it's still not working for me either.
Can anyone work out why it's not functioning as expected?

I think it's to do with the javascript file reference to cookies and/or something overriding the system setting for the default font size!?

My trail goes like this...

After adding the HTML code to your page template
***** Manual signatures are NOT allowed *****

largersmallerreset

***** Manual signatures are NOT allowed *****

You change all those references to where you have put the button artwork in your templates folder.

Then you need to add the CSS buttons item for the buttons to your CSS file
eg. see the CSS for this page

http://forum.joomla.org/Themes/joomla/c ... te_css.css
***** Manual signatures are NOT allowed *****
/** css buttons **/
#css_buttons {
width: auto;
white-space: nowrap;
float: right;
margin-top: 85px;
margin-right: 20px;
}

#css_buttons a {
margin-right: 1px;
}
***** Manual signatures are NOT allowed *****

Then drop the javascript file into your template folder or wherever you want it and reference it in the html page header of wherever the javascript lives.
eg. see for this page



ie. pull that url up in your browser and save it as a text file.
and add the line above reference into your HTML

And then drop the buttons artwork into the right place.

Then it should work - but it doesn't.
Any help would be appreciated as this is a really useful feature.


Top
 Profile  
 
PostPosted: Wed Sep 21, 2005 2:57 am 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Sat Aug 20, 2005 4:15 am
Posts: 1256
Location: California, USA
mambogfx, if you used php wouldn't it have to parse the script with a new page load for each time you changed the font size? Correct me if I'm wrong, but wouldn't that be a bit more resource intensive?

_________________
[size=70] Paul
http://www.gamehostingreviews.com - In development
The only thing necessary for the triumph of evil is for good men to do nothing. - Edmund Burke


Top
 Profile  
 
PostPosted: Wed Sep 21, 2005 10:09 am 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Thu Aug 18, 2005 9:19 am
Posts: 408
Location: Peterborough, UK
Quote:
Then it should work - but it doesn't.
Any help would be appreciated as this is a really useful feature.


I've been struggling with this for the last hour.  Very frustrating but I finally figured out what was going wrong (for me, at least): You need to set the font-size on the BODY element in the CSS file to say 80%, then make sure that all other font-size specifications in your CSS file are set to em sizes rather than px or pt.  Then make sure that your index.php file has the doctype declaration right at the very top - before the xml declaration.  That is the only way to get IE out of quirks mode - it ignores doctypes if anything else comes beforehand.

Hope this helps!

_________________
Netshine Software Limited
www.netshinesoftware.com


Top
 Profile  
 
PostPosted: Wed Sep 21, 2005 3:29 pm 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Thu Aug 18, 2005 10:11 pm
Posts: 1371
Location: San Juan - Argentina
Hi guys
I've been trying to make this feature work, but had no luck...
Could any1 implement this in a template ?

It'd be nice that the guy who made the joomla.org's template to give us some tips to acchieve this...

_________________
@kabeza
Freelance Joomla/codeIgniter Developer
Home: http://www.beza.com.ar


Top
 Profile  
 
PostPosted: Wed Sep 21, 2005 6:00 pm 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Thu Aug 18, 2005 9:19 am
Posts: 408
Location: Peterborough, UK
The Globalbiz template on Jamobworks has this feature:

http://www.jamboworks.com/Products/Template_Club/GlobalBiz_-_July_2005_Template/

You have to be a member to get it though...

...alternatively, just go to joomla.org, click File->Save As, save it to your desktop, then take a look at the css and js files.

_________________
Netshine Software Limited
www.netshinesoftware.com


Top
 Profile  
 
PostPosted: Thu Sep 22, 2005 5:50 am 
User avatar
Joomla! Intern
Joomla! Intern

Joined: Thu Aug 18, 2005 10:18 pm
Posts: 72
TheSaint wrote:
mambogfx, if you used php wouldn't it have to parse the script with a new page load for each time you changed the font size? Correct me if I'm wrong, but wouldn't that be a bit more resource intensive?

Yes but where is the Problem? It´s save in a Cookie and your Guest get the same fontsize when he come back


Top
 Profile  
 
PostPosted: Thu Sep 22, 2005 2:29 pm 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Thu Aug 18, 2005 10:11 pm
Posts: 1371
Location: San Juan - Argentina
netshine wrote:
The Globalbiz template on Jamobworks has this feature:

http://www.jamboworks.com/Products/Template_Club/GlobalBiz_-_July_2005_Template/

You have to be a member to get it though...

...alternatively, just go to joomla.org, click File->Save As, save it to your desktop, then take a look at the css and js files.


OMG... what a pitty it is commercial stuff... :(

_________________
@kabeza
Freelance Joomla/codeIgniter Developer
Home: http://www.beza.com.ar


Top
 Profile  
 
PostPosted: Thu Sep 22, 2005 3:01 pm 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Thu Aug 18, 2005 9:19 am
Posts: 408
Location: Peterborough, UK
I have e-mailed Jamboworks to ask them if they would mind making that particular javascript file open source.  If I get the go-ahead from them, I will release an open source template with this text-resizing feature in it and I'll update this thread to let you know.

:)

_________________
Netshine Software Limited
www.netshinesoftware.com


Top
 Profile  
 
PostPosted: Thu Sep 22, 2005 4:53 pm 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Fri Aug 26, 2005 5:05 am
Posts: 294
Location: Pennsylvania, USA
You may want to look at this thread....

http://forum.joomla.org/index.php/topic,4321.msg49719.html#msg49719

_________________
Robert Anthony Pitera
West of East, Inc. - http://www.westofeast.com - Taking technology in new directions™


Top
 Profile  
 
PostPosted: Fri Sep 23, 2005 7:35 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Fri Sep 16, 2005 6:32 pm
Posts: 145
Location: San Francisco
I just got around to adding the "style changer" to my template. It works great. Initially I was confused by the fact that you have to switch to % or em sizes to have the fonts change but this actually turns out to be a feature. It means that if you don't want a font to be adjusted by the javascript you can specify it's height using pt's or px's. I find this usefull for various non-content header, footer and navigation elements which I want to remain fixed sizes. Then set the main content CSS to say 80% (the actual amount is irrelevant as it is overridden by the javascript anyway) and only the main content elements will be resized.  8)

_________________
Jon Palmer


Top
 Profile  
 
PostPosted: Fri Sep 23, 2005 1:11 pm 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Fri Aug 26, 2005 5:05 am
Posts: 294
Location: Pennsylvania, USA
Also using ems and %, the user can change the font size in the browser.  As I'm learning more about this I am changing things to become more standardized.

_________________
Robert Anthony Pitera
West of East, Inc. - http://www.westofeast.com - Taking technology in new directions™


Top
 Profile  
 
PostPosted: Fri Sep 23, 2005 1:38 pm 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Thu Aug 18, 2005 10:11 pm
Posts: 1371
Location: San Juan - Argentina
netshine wrote:
I have e-mailed Jamboworks to ask them if they would mind making that particular javascript file open source.  If I get the go-ahead from them, I will release an open source template with this text-resizing feature in it and I'll update this thread to let you know.

:)


great news ! hope they make this stuff free soon !

_________________
@kabeza
Freelance Joomla/codeIgniter Developer
Home: http://www.beza.com.ar


Top
 Profile  
 
PostPosted: Fri Sep 23, 2005 2:44 pm 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Thu Aug 18, 2005 9:19 am
Posts: 408
Location: Peterborough, UK
Ok, I got permission to use the script so I have added it to 2 different templates, both of which are available here:

http://www.netshinesoftware.com/mambo-development.html

'Netshine Basic' is a very lightweight table-less CSS fixed-width template.  Due to its minimalist nature, it should be quite easy to see how it all works - there is no unnecessary code getting in the way.  This template can also be used as a basis for building a more complex one.

'XPLike.Plesk.Blue.2' is a much more complicated template - a conversion from the SWSoft release for Mambo 4.5.0.  It is the template my own site uses, so I have added the accessibility features to that too.

:D

_________________
Netshine Software Limited
www.netshinesoftware.com


Top
 Profile  
 
PostPosted: Sat Sep 24, 2005 6:09 pm 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Thu Aug 18, 2005 10:11 pm
Posts: 1371
Location: San Juan - Argentina
thanks netshine !
I didn't notice this reply you made in the thread...

Gonna try the templates... thanks 4 your help ! :D

_________________
@kabeza
Freelance Joomla/codeIgniter Developer
Home: http://www.beza.com.ar


Top
 Profile  
 
PostPosted: Thu Oct 27, 2005 1:17 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Fri Sep 02, 2005 3:14 pm
Posts: 237
Location: England
netshine wrote:
Quote:
Then it should work - but it doesn't.
Any help would be appreciated as this is a really useful feature.


I've been struggling with this for the last hour.  Very frustrating but I finally figured out what was going wrong (for me, at least): You need to set the font-size on the BODY element in the CSS file to say 80%, then make sure that all other font-size specifications in your CSS file are set to em sizes rather than px or pt.  Then make sure that your index.php file has the doctype declaration right at the very top - before the xml declaration.  That is the only way to get IE out of quirks mode - it ignores doctypes if anything else comes beforehand.

Hope this helps!


You are a genius!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I have spent hours and hours trying to figure out why the hell the style changer would not work with IE. Man I could cry about how much time I have wasted when the solution was right here. I searched and looked through the other threads about this font resizer but nothing came up only just managed to stumble upon this one, why it didnt come up in my other searches I dont know.


Top
 Profile  
 
PostPosted: Sun Oct 30, 2005 9:43 am 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Thu Aug 18, 2005 9:19 am
Posts: 408
Location: Peterborough, UK
Glad to be of service!  ;D

_________________
Netshine Software Limited
www.netshinesoftware.com


Top
 Profile  
 
PostPosted: Mon Oct 31, 2005 10:17 am 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Aug 29, 2005 8:59 am
Posts: 35
Location: Iowa
netshine wrote:
Ok, I got permission to use the script so I have added it to 2 different templates, both of which are available here:

http://www.netshinesoftware.com/mambo-development.html
[...]



Thank you netshine!!!

your "basic" one serves me as a tutorial :) (and as a "template to create a template")

one thing I noticed in the basic: you have some images pointing to /templates/xplike.plesk.blue.2/images
I did not notice that until I started working on the basic template, because I downloaded and installed both

also... I noticed that you have a footer that states:
Joomla! "Basic" Template by Netshine Software Limited with the link to Netshine.
Do you want us to keep that as is, or only to make some reference to your work?... For the site I'm working with, I would like to use something like:
Design by Marcos using a template provided by by Netshine Software Limited

furthermore, I do have another client that do not want anything on the webpage besides their own webmaster... I could leave a message in the source, but I don't know if that's agreable with you.

Thanks!!!
Marcos


Top
 Profile  
 
PostPosted: Mon Oct 31, 2005 4:25 pm 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Thu Aug 18, 2005 9:19 am
Posts: 408
Location: Peterborough, UK
Oops - must've copied and pasted something from the xplike.plesk template  :-[

You can do what you like with the copyright message - remove it entirely if you wish.  Of course, credits and links back to netshinesoftware.com are always welcome!  :D

_________________
Netshine Software Limited
www.netshinesoftware.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 26 posts ] 



Who is online

Users browsing this forum: No registered users and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group