[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Font Size Increase/Decrease

Posted on 2015-01-05
5
Medium Priority
?
126 Views
Last Modified: 2015-01-15
Hello,

I have a website and I need put in a increase font section... i have the three graphics already inplace but I don't know how to make the buttons work....   Can anyone help with the code for this??

Here is the website address for the site i am using..

ckhatest.jadeddesigns.ca

Thank you,
0
Comment
Question by:cookmyster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 43

Expert Comment

by:Rob
ID: 40532613
With jQuery:

I've used * for all elements, however you may want to just to p elements or divs or spans etc
jQuery(function() {
jQuery('#id_of_increase_btn').on('click', function() {
// to increase
jQuery('*').css('font-size', function(i, size) { return parseFloat(size)*1.2; });
});    

jQuery('#id_of_decrease_btn').on('click', function() {
// to decrease
jQuery('*').css('font-size', function(i, size) { return parseFloat(size)/1.2; });
});

});

Open in new window

0
 
LVL 43

Accepted Solution

by:
Rob earned 2000 total points
ID: 40532620
0
 
LVL 2

Author Comment

by:cookmyster
ID: 40533389
Hey Rob,

when i put the javascript into a .js file and call it form the page I am working on... it doesn't seem to work.. but when i put al the javascript on the same page.. it works??  not sure what i am doing wrong

Rich
0
 
LVL 43

Expert Comment

by:Rob
ID: 40533464
Yeah it shouldn't matter so how are you including it and where in your page?
Is the code exactly the same whether in the page or in an external file?
Regardless the code has to be within a $(function() {...}) initialization or a function that is called after the page had loaded.
0
 
LVL 2

Author Closing Comment

by:cookmyster
ID: 40552174
Awesome!!!  thank you very much
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question