3
I’m trying to create a <input type="range">
which increases and/or decreases the size of the text as we move it left or right.
So far so good, I was able to create this effect, but now I wanted to put a number indicating the font-size
after we moved the <input type="range">
and I blocked that part.
Here’s the code I got so far:
$("#fader").on("input",function () {
$('#v-28').css("font-size", $(this).val() + "px");
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<p id="valor-fontSize">40</p>
<input class="none" type="range" min="14" max="40" value="0" id="fader" step="1" >
<p id="v-28">
Após uma viagem que se prolongou por mais de nove anos e em que percorreu 4,8 mil milhões de quilómetros a New Horizons passou o mais perto de Plutão às 11:49 TMG (12:49 em Lisboa) em piloto automático, divulgou a NASA na rede social Twitter.
</p>
Here’s an example in jsFiddle as well: http://jsfiddle.net/Lucp945b/
If it were a
input
that could put the number or value of thefont-size
that we want the text to stay and at the same time move theinput range
to the place where supposedly this value would be located in theinput range
would be even better.
Is this what you’re looking for? -> http://jsfiddle.net/Lucp945b/1/
– Sergio
Just like that, this is what I wanted @Sergio! : D Thanks. put there as an answer
– Chun