Create button Increase / Decrease font size in article Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.
5 posters

    Create button Increase / Decrease font size in article

    tonetone
    tonetone
    Forumember


    Male Posts : 31
    Reputation : 2
    Language : English
    Location : Japan

    Solved Create button Increase / Decrease font size in article

    Post by tonetone January 7th 2015, 3:54 am

    Here is the sample code:
    Code:
    <script type='text/javascript'>
    //<![CDATA
    function fontIncrease(){
    var obj = document.getElementById("text_Font");
    if (obj.style.fontSize==""){obj.style.fontSize="12px"};
    if (obj.style.fontSize=="10px"){obj.style.fontSize = "12px";}
    else if (obj.style.fontSize=="12px"){obj.style.fontSize = "15px";}
    else if (obj.style.fontSize=="15px"){obj.style.fontSize = "17px";}
    else if (obj.style.fontSize=="17px"){obj.style.fontSize = "19px";}
    else if (obj.style.fontSize=="19px"){obj.style.fontSize = "21px";}
    }
    function fontDecrease(){
    var obj = document.getElementById("text_Font");
    if (obj.style.fontSize==""){obj.style.fontSize="12px"};
    if (obj.style.fontSize=="21px"){obj.style.fontSize = "19px";}
    else if (obj.style.fontSize=="19px"){obj.style.fontSize = "17px";}
    else if (obj.style.fontSize=="17px"){obj.style.fontSize = "15px";}
    else if (obj.style.fontSize=="15px"){obj.style.fontSize = "12px";}
    else if (obj.style.fontSize=="12px"){obj.style.fontSize = "10px";}
    }
    //]]>
    </script>

    Create button Increase / Decrease font size in article Dynamic-font-resize

    Who can teach me how to use the function in my forum?


    Last edited by tonetone on January 7th 2015, 2:55 pm; edited 1 time in total (Reason for editing : Solved)
    _Twisted_Mods_
    _Twisted_Mods_
    Helper
    Helper


    Male Posts : 2083
    Reputation : 336
    Language : English
    Location : Ms

    Solved Re: Create button Increase / Decrease font size in article

    Post by _Twisted_Mods_ January 7th 2015, 8:30 am

    acp>modules>javascript management

    make sure javascript is turned on  .. if not  turn it on and save  then

    create a new javascript and set
    titlle: dont matter
    placement in topics


    you can change the images to what ever u like
    Code:
    $(function(){
    var minimg = 'http://icons.iconarchive.com/icons/icons8/windows-8/16/Very-Basic-Minus-icon.png';
    var maximg = 'http://icons.iconarchive.com/icons/icons8/windows-8/16/Very-Basic-Plus-icon.png';
    $('#main-content .post_body').prepend('Font Size: <img id="plfonsize" src="'+maximg+'"><img src="'+minimg+'" id="minfonsize"><br><br> ');
    $('#main-content .post_body').css('line-height','initial');
    $('#plfonsize').click(function(){
    str = parseInt($(this).parent().css('font-size'));
    $(this).parent().css('font-size',str+2+"px");
    });
    $('#minfonsize').click(function(){
    str = parseInt($(this).parent().css('font-size'));
    $(this).parent().css('font-size',str-2+"px");
    });
    });
    tonetone
    tonetone
    Forumember


    Male Posts : 31
    Reputation : 2
    Language : English
    Location : Japan

    Solved Re: Create button Increase / Decrease font size in article

    Post by tonetone January 7th 2015, 2:53 pm

    Thank you! My request 's completed.
    Michael_vx
    Michael_vx
    Forumember


    Male Posts : 659
    Reputation : 29
    Language : Arabic and some English
    Location : Egypt

    Solved Re: Create button Increase / Decrease font size in article

    Post by Michael_vx January 7th 2015, 6:05 pm

    sorry for jumping in
    what version for this Script Very Happy
    Eugeo Igvalt
    Eugeo Igvalt
    Forumember


    Male Posts : 289
    Reputation : 17
    Language : EN, SPA
    Location : Puerto Rico

    Solved Re: Create button Increase / Decrease font size in article

    Post by Eugeo Igvalt January 7th 2015, 6:22 pm

    Michael_vx wrote:sorry for jumping in
    what version for this Script Very Happy
    Good question, and I'd like to know like Michael if this works for phpBB3
    Ape
    Ape
    Administrator
    Administrator


    Male Posts : 19314
    Reputation : 2005
    Language : fluent in dork / mumbojumbo & English haha

    Solved Re: Create button Increase / Decrease font size in article

    Post by Ape January 7th 2015, 6:50 pm

    That code is for punbb forums 
    to get your forum code please make your own threads
    Thank you
    Topic solved and archived



    Create button Increase / Decrease font size in article Left1212Create button Increase / Decrease font size in article Center11Create button Increase / Decrease font size in article Right112
    Create button Increase / Decrease font size in article Ape_b110
    Create button Increase / Decrease font size in article Ape1010