3
How to make a Javascript function that checks whether the scroll of a textarea (this textarea has a disclaimer) has been moved.
If the user moves the scroll, enable a div
with the continuation of a registration form.
Follows the code:
<script>
document.getElementById('id').onscroll = function(){
alert('foi movido');
}
</script>
Thank you very much Silvio Andorinha.
– Geraniel
He didn’t mention jquery, just javascript. It was interesting to complete his reply by inserting an example with pure javascript.
– Filipe Moraes
@Filipe ok, I’m doing some tests here and I already complement the answer
– Silvio Andorinha
I am zero in javascript knowledge. It didn’t work here
– Geraniel
@Geraniel edit your question and post the code of your textarea please..
– Silvio Andorinha
http://jsfiddle.net/an9Na/ a look here’s working.
– Geraniel
@Geraniel edited the question using the
window.onload
take the test again– Silvio Andorinha
@Geraniel yes it is because of the
window.onload
take the test with the change I made in response.– Silvio Andorinha
show stayed tri http://jsfiddle.net/nF7Qm/ . Thank you very much
– Geraniel
@Geraniel I am happy to help, as you are new on the site I advise you to take a look at this page
– Silvio Andorinha
@Geraniel and if the answer helped you, please don’t forget to mark it as sure ;)
– Silvio Andorinha