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.

Create button Increase / Decrease font size in article

5 posters

Go down

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)
tonetone
tonetone
Forumember

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

http://yeucotuong.123.st

Back to top Go down

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");
});
});
_Twisted_Mods_
_Twisted_Mods_
Helper
Helper

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

http://liquidcode.forumotion.com

Back to top Go down

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.
tonetone
tonetone
Forumember

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

http://yeucotuong.123.st

Back to top Go down

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
Michael_vx
Michael_vx
Forumember

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

Back to top Go down

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
Eugeo Igvalt
Eugeo Igvalt
Forumember

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

http://www.NewbForums.com

Back to top Go down

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
Ape
Ape
Administrator
Administrator

Male Posts : 19452
Reputation : 2012
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum