Resolved WordPress - font resizer

Discussion in 'Tech Discussion' started by Eques, Jul 1, 2019.

  1. Eques

    Eques Translation machine (not)

    Joined:
    May 10, 2017
    Messages:
    603
    Likes Received:
    726
    Reading List:
    Link
    Guuuuys, I need me some help here. :blob_teary:

    I want to add font resizer to my site, but not as a widget.
    Any propositions for plugin/CSS code?
     
  2. cosmosg

    cosmosg Well-Known Member

    Joined:
    Apr 6, 2019
    Messages:
    126
    Likes Received:
    56
    Reading List:
    Link
    put this in addtional css of customizartion tab
    p {
    font-size:19px;
    }
    change 19px to size of your choice
     
  3. cosmosg

    cosmosg Well-Known Member

    Joined:
    Apr 6, 2019
    Messages:
    126
    Likes Received:
    56
    Reading List:
    Link
    it only changes font size of <p> tag.
    I'm guessing that you want to increase size of the text of your novel chapter
     
  4. SilvaLau

    SilvaLau Well-Known Member

    Joined:
    Jan 23, 2016
    Messages:
    290
    Likes Received:
    264
    Reading List:
    Link
    I believe what he wanted is a button to change the size of the text according to user's preferences?

    Your coding seems to be a permanent change..
     
  5. Eques

    Eques Translation machine (not)

    Joined:
    May 10, 2017
    Messages:
    603
    Likes Received:
    726
    Reading List:
    Link
    Yeah, permanently changing the font size is no problem. What I need is that nifty little thing some pages have above or under the post title, changing only the font size of the content.
     
  6. Guess Who

    Guess Who Well-Known Member

    Joined:
    Mar 13, 2016
    Messages:
    100
    Likes Received:
    65
    Reading List:
    Link
    Code:
    <html>
    <body>
    <input type="button" value="Increase Font Size 2px" onclick="increaseFontSizeBy2px()">
    <input type="button" value="Decrease Font Size 2px" onclick="decreaseFontSizeBy2px()">
    <p id="b">Font Size by 1 Pixel</p>
    </body>
    <script>
    function increaseFontSizeBy2px() {
        txt = document.getElementById('b');
        style = window.getComputedStyle(txt, null).getPropertyValue('font-size');
        currentSize = parseFloat(style);
        txt.style.fontSize = (currentSize + 2) + 'px';
    }
    function decreaseFontSizeBy2px() {
        txt = document.getElementById('b');
        style = window.getComputedStyle(txt, null).getPropertyValue('font-size');
        currentSize = parseFloat(style);
        txt.style.fontSize = (currentSize - 2) + 'px';
    }
    </script>
    </html>
    I tried this after searching for a bit on stackoverflow :)
    Here's the sauce https://stackoverflow.com/questions...ith-a-click-of-a-button-using-only-javascript
     
    Kuro_0ni and Eques like this.
  7. Eques

    Eques Translation machine (not)

    Joined:
    May 10, 2017
    Messages:
    603
    Likes Received:
    726
    Reading List:
    Link
    Thank you, I'll try it out.
     
  8. Eques

    Eques Translation machine (not)

    Joined:
    May 10, 2017
    Messages:
    603
    Likes Received:
    726
    Reading List:
    Link
    Thank you, I already resolved this problem by doing what I didn't want to do - adding font resize option as a widget. Oh well.
     
  9. samzike

    samzike New Member

    Joined:
    Sep 19, 2019
    Messages:
    6
    Likes Received:
    1
    Reading List:
    Link
    I recommend using Zeno Font Resizer. Thanks me later.
     
    Eques likes this.
  10. Eques

    Eques Translation machine (not)

    Joined:
    May 10, 2017
    Messages:
    603
    Likes Received:
    726
    Reading List:
    Link
    Thank you, that's exactly the plugin I'm using.