Updating Content and Values in Scrolling Divs
Demonstrating Dynamic Update
Refreshing Scrolling Divs
Click the links on the right to see new content swapped into this scroll area. The "Swap Content" and "Original Content" links toggle the visibility of divs that are nested within this scroll area.
The "Add Content" link will add a bit of content to whatever div is visible in this scroll area to demonstrate the code's ability to adapt to changes in content.
If one of the divs does not contain enough content for scrolling to be required, the scroll controls will be hidden by default, although you can easily override this feature if you prefer.
This content is in another div originally hidden within the scroll area. An unlimited number of hidden divs can be nested within a scroll area for the purpose of swapping content.
The documentation has information on setting up divs and links for swapping.
The "Toggle Display" link swaps another div in this scroll area and shows how the scrolling divs code can respond to changes in content size when elements inside are expanded and contracted.
The scroll controls can be hidden if the amount of content in the div is not sufficient to require scrolling.
Toggling Display in Scroll Divs
The links below demonstrate the scrolling divs capability to adapt to changes in content size. Clicking the links toggles display between
Methods for Updating Scroll Areas
Two methods are provided for use when the content of a scroll area is replaced or modified:
updateDims method recalculates maximum values for scrolling based on any changes that may have been made to affect the scroll area dimensions. It also updates the scrollbar. If you have code that makes changes to scroll area content affecting its dimensions, you could include the following to update the scroll values:
var wndo = dw_scrollObj.col['wn']; // scroll area id wndo.updateDims();
refreshAll method applies
updateDims to all scroll areas you have implemented in your document. It can be invoked as follows: