can a user control the articals font size ?

0
can i make a button that increases/decreases the font size in page ? Attar Dasthagir your solution is only setting my arcticel's font to 5px it is not adding 5px for each click
asked
3 answers
5

Hi Ibrahim Sab,

You Can use this link 

https://stackoverflow.com/questions/38627822/increase-the-font-size-with-a-click-of-a-button-using-only-javascript

as the JS Code wants to be added in the Javascript action and it needs to be called in a nanoflow that nanoflow needs to be called from a button where use +5px instead of 100px in the example code.

 

Hope this helps.

answered
0

Yes, On that button call a nanoflow and change the CSS properties or add remove CSS from the elements.

answered
0

Hi Ibrahim Sab,

Please use the below code for increasing the font size for +5px until how much you want you just call this code in a javascript action and this javascript action needs to be called in a button.
export async function JavaScript_action_IncreaseFont() {
let txt = document.querySelectorAll('.a label');
for(let text of txt){
let style = window.getComputedStyle(text, null).getPropertyValue('font-size');
let currentSize = parseFloat(style);
text.style.fontSize = (currentSize + 5) + 'px';
}

here is the code for decreasing the font size with 5px.
export async function JavaScript_action_DecreaseFont(parameter) {
let txt = document.querySelectorAll('.a label');
for(let text of txt){
let style = window.getComputedStyle(text, null).getPropertyValue('font-size');
let currentSize = parseFloat(style);
text.style.fontSize = (currentSize - 5) + 'px';
}

 

answered