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
inputthat could put the number or value of thefont-sizethat we want the text to stay and at the same time move theinput rangeto the place where supposedly this value would be located in theinput rangewould 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