Article

Using Scroll to change text size

https://cdn.jsdelivr.net/npm/[email protected]/dist/js.cookie.min.js
Copy to clipboard

In this example we scroll over the list to increase the text size of a separate div. We limit our final text size to 30px. https://raw.githubusercontent.com/finsweet/jqueryCourse/main/jquery%20events/ex34.js?actionable=true

<script>
$(document).ready(function(){
  XT1
});
</script>
Copy to clipboard
Send to Live Demo

Live demo

<style>#color-list{max-height: 120px;    overflow-y: scroll;}</style><div id="minidivpage" class="example-live"><h4 class="heading-4">Scroll this list:</h4><ul id="color-list" role="list" class="list"><li>Purple</li><li>Blue</li><li>Magenta</li><li>Pink</li><li>Black</li><li>Red</li><li>Green</li></ul><div id="position" class="box">This is some text inside of a div block.</div><a href="#" class="button-3 w-button demo-button">Scroll</a></div>

<script>    
$(document).ready(function() {
  XT1
});
</script>
<script>
  
</script>
Copy to clipboard
Press the Run Demo button to execute the scripts above.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Your browser is too small

Resize your browser to be at least 769px wide.