[SOLVED] Minimize and maximize page text with buttons

I would like to know how to minimize and maximize text that appears on a page by clicking for example the - Button to make the text smaller or to click + to make the whole text bigger. Does anybody have an idea?

  • Stephanie

Hello Stephanie,

Yes it’s fairly easy to do, but as you know Ionic is also a mobile app factory. As such, in a Ionic Ios or Android version of your Ionic application, users can zoom any time they want with double fingers like any mobile app.

Do you need more than that?

And to complement on your question, if you build a TS/JS class that change CSS style, it’s super easy to put a button to augment or downgrade text size on any page. It’s standard HTML/CSS (SCSS in Ionic). I can put a demo if you want.

Hello FrancoisIonic,
thank you for your reply!

I am a programming beginner and programming is still really difficult for me and sometimes easy stuff seems so unmakeable :frowning:

As the functionality I have to apply is part of a project, I have to use buttons to increase and decrease the font size. I aligned two buttons in the navigationbar of my home.html file yet. By now, only the functionality won’t work.
I tried using this example here: https://github.com/judgewest2000/IonicDynamicTextSizeExample/tree/master/src/pages/home

But unfortunately that wasn’t exactly what I needed and it wasn’t working for the whole page (my page also includes an ion-card that is filled with text).

I would be really grateful if you could give me a better functionality for my problem?

Hello, glad to help, many people helped me in these forums,

In fact to explain you I have 2 options, I prefer the first one with concrete examples. The tutorial you showed me is very bad, sorry :confused:

And yes, it’s quite easy to do much better. But it requires you have intermediate skills in JS/TS. Do you have time to learn?


Yes, I am willing to learn and I also have time to learn!!!

I understand JS as I read a lot of the documentation. I more likely don’t know how to create the functions to let mi methods do what the sould do. I was also thinking in a if-else-loop with boolean parameters but I don’t know how to “realize” it…

If you want, i’ll give you a free customized course to all my knowledge by screencast + audio on thursday, 3 pm CET. I’ll put it on the slack when i’m ready.

it’s not uber complicated, but it’s always good to have a demo show :slight_smile:

Yes, please!!! Thursday is fine, via Sykpe?

Yes ok, because I will have contractors in my small flat Thursday ( they repair my window ), I will be available from 3 pm to 5pm at least, where do you live please, @merma90?

skype is fine too, but i don’t have it

I live in Europe, Germany! 15:00 - 17:00 is fine too! I can install the program you’ll be using. What’s the name of the program?

do you have discourse? I find it nice for talk

well as you wish, me i hate skype sorry, but i can have anything more or less (i’m french from small brittany —> more like people like celts)

I will download “discourse”, don’t worry :slight_smile:

Do you have a link for the download? I don’t know which one is the right one…

do you use only linux in germany ? :stuck_out_tongue:

it’s not a try to joke, i use windows but i prefer linux

mostly… it’s a student-engineer-thing, but I am an exception because I use windows :smiley:

and i have the link for the dl, but it looks like you are a good devops too

:slight_smile: it’s nice, i’m happy to talk with ionic people a bit