Scrolling to an anchor within a dynamic panel


I’ve used a treeview navigation and when you click on nodes in the tree i’d like the content (currently in a scrollable dynamic panel) to scroll to that heading (think Wikipedia). This feels like quite a common web navigation pattern, but i can’t get it to work. Am I missing something?
Example attached.scrolling within dynamic panel.rp (56.4 KB)


A dynamic panel won’t scroll if it’s tall enough to already display all of its content, just like you can’t scroll a browser window when you see the whole web page.

For example, make the dynamic panel 500 tall and everything will work. If you want to make the dynamic panel the height of your screen, you can add this code to the page:

On Window Resize
   Set size of dynamic panel to  [[Target.width]]  [[Window.height]]

[edit] use this code instead:

Set size of dynamic panel to [[Target.width]] [[Window.height - Target.y]]

…which will work even if the dynamic panel isn’t located at y=0