Hi Tintin!
These are all good questions. The main thing is that just because a panel in not set to Fit to Content doesn’t mean it can’t be resized. There is a Resize command, which you might utilize in a responsive situation. In which case OnResize would respond to the resizing and adjust everything appropriately.
It’s also good not to use hardcoded numbers but use instead object properties (object.width, object.height, object.x) that those hardcoded numbers are based on. That way you can change the size of something or move it - even in Axure - and not update any code.
You did catch an oddity in the resize code. The event firing (OnLoad firing OnResize) should have taken place on the outermost panel, not the inner scrollng one. I’m attaching the updated version.
When you open it, resize the outer panel to whatever size you want and then run it. I think you’ll immediately understand why we are not using hardcoded numbers, because everything will automatically adjust to this new size.
Here’s why:
Because the outer panel’s OnLoad is firing OnResize, all its OnResize code runs when the prototype loads: It resizes the inner scrolling panel to its own size plus an extra 20 in width (to hide the real scrollbar off-panel). And when, in turn, the inner scrolling panel is resized (by the aforementioned code), its own OnResize handler gets fired and adjusts the scrollbar height, etc.
New file: fake_scrollbar.rp (73.1 KB)