In this tutorial you will learn how to create a scrolling message within a text box. Here are the steps.
Define a variable (pos) to store the current scroll position.
Write a function that will:
- get the id value of the scrolling text box.
- subtract 1 from pos and check pos value using offsetHeight, which retrieves the height of the object relative to the layout.
- set a new height value using JavaScript style object.
- finally the function calls itself using a timeout.
Post a Comment