The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Create button Increase / Decrease font size in article

View previous topic View next topic Go down

Solved Create button Increase / Decrease font size in article

Post by tonetone on 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>



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

Male Posts : 2064
Reputation : 314
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 on January 7th 2015, 2:53 pm

Thank you! My request 's completed.
avatar
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 on January 7th 2015, 6:05 pm

sorry for jumping in
what version for this Script Very Happy
avatar
Michael_vx
Forumember

Male Posts : 664
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 on 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
avatar
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 on 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



avatar
APE
Manager
Manager

Male Posts : 11006
Reputation : 1031
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

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

Back to top Go down

View previous topic View next topic Back to top


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