Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6531617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:53:59+00:00 2026-05-25T09:53:59+00:00

I am working on a project and having trouble to increase or decrease font

  • 0

I am working on a project and having trouble to increase or decrease font size of the site. I am using wordpress, Genesis framework but unable to increase/decrease font size via javascript.

Please kindly help me to solve this.

i use the following code;

genesis_after Hook
This hook executes immediately before the closing tag.

<script type="text/javascript" language="javascript">
$(document).ready(function(){
  // Reset Font Size
  var originalFontSize = $('html').css('font-size');
  $(".resetFont").click(function(){
  $('html').css('font-size', originalFontSize);
  });
  // Increase Font Size
  $(".increaseFont").click(function(){
    var currentFontSize = $('html').css('font-size');
    var currentFontSizeNum = parseFloat(currentFontSize, 10);
    var newFontSize = currentFontSizeNum*1.2;
    $('html').css('font-size', newFontSize);
    return false;
  });
  // Decrease Font Size
  $(".decreaseFont").click(function(){
    var currentFontSize = $('html').css('font-size');
    var currentFontSizeNum = parseFloat(currentFontSize, 10);
    var newFontSize = currentFontSizeNum*0.8;
    $('html').css('font-size', newFontSize);
    return false;
  });
});
</script>

genesis_before_content Hook
This hook executes immediately before the content column (outside the #content div).

<a href="#" class="increaseFont">Increase</a>
<a href="#" class="decreaseFont">Decrease</a>
<a href="#" class="resetFont">Reset</a>

my project link is

http://174.121.86.229/~rghlifts/

please help me to resolve the issue

thank you all

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T09:54:00+00:00Added an answer on May 25, 2026 at 9:54 am

    In WordPress jQuery is default with noConflict. You must change in your script all “$” to “jQuery”.

    <script type="text/javascript" language="javascript">
    function createCookie(name,value,days) {
        if (days) {
            var date = new Date();
            date.setTime(date.getTime()+(days*24*60*60*1000));
            var expires = "; expires="+date.toGMTString();
        }
        else var expires = "";
        document.cookie = name+"="+value+expires+"; path=/";
    }
    function getCookie(name) {
        var nameEQ = name + "=";
        var ca = document.cookie.split(';');
        for(var i=0;i < ca.length;i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1,c.length);
            if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
        }
        return null;
    }
    
    jQuery(document).ready(function(){
        var fontSizeCookie = getCookie('font_size');
        if (typeof fontSizeCookie !== 'undefined' && fontSizeCookie != null) {
            jQuery('html').css('font-size', fontSizeCookie+'px');
        }
    
        // Reset Font Size
        var originalFontSize = 10;
        jQuery(".resetFont").click(function(){
            jQuery('html').css('font-size', originalFontSize);
            createCookie('font_size', originalFontSize, 365);
        });
        // Increase Font Size
        jQuery(".increaseFont").click(function(){
            var currentFontSize = jQuery('html').css('font-size');
            var currentFontSizeNum = parseFloat(currentFontSize, 10);
            var newFontSize = currentFontSizeNum*1.2;
            jQuery('html').css('fontSize', newFontSize+'px');
            createCookie('font_size', newFontSize, 365);
            return false;
        });
        // Decrease Font Size
        jQuery(".decreaseFont").click(function(){
            var currentFontSize = jQuery('html').css('font-size');
            var currentFontSizeNum = parseFloat(currentFontSize, 10);
            var newFontSize = currentFontSizeNum*0.8;
            jQuery('html').css('fontSize', newFontSize);
            createCookie('font_size', newFontSize, 365);
            return false;
        });
    });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a project and having trouble with my UL>LI style. i
I am working on a project for a class and I am having trouble
I'm working through the random machine example , but I'm having trouble. I've installed
I'm working on an anti-spam project ( centmail ) that involves having the sender
I'm currently working on project with Haskell, and have found myself some trouble. I'm
I'm creating an RPN calculator for a school project and having trouble with the
I'm working on a project which is using Audio Toolbox for recording and playback
I'm working on a flash web application (Actionscript 2.0) for my honours project but
I'm working on a project that will be using a lot of select menus
I am working on a project to take an existing project using JSF1.2, JSP,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.