Create button Increase / Decrease font size in article
5 posters
Page 1 of 1
Create button Increase / Decrease font size in article
Here is the sample code:
Who can teach me how to use the function in my forum?
- 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)
Re: Create button Increase / Decrease font size in article
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
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");
});
});
Re: Create button Increase / Decrease font size in article
sorry for jumping in
what version for this Script
what version for this Script
Michael_vx- Forumember
- Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt
Re: Create button Increase / Decrease font size in article
Good question, and I'd like to know like Michael if this works for phpBB3Michael_vx wrote:sorry for jumping in
what version for this Script
Re: Create button Increase / Decrease font size in article
That code is for punbb forums
to get your forum code please make your own threads
Thank you
to get your forum code please make your own threads
Thank you
Topic solved and archived
Similar topics
» Like button font size
» rank font size
» Insert new font in font button (punbb)
» Miniprofile Font size
» HTML Font Size Problem
» rank font size
» Insert new font in font button (punbb)
» Miniprofile Font size
» HTML Font Size Problem
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum