开发者

How to fix the page position when I resize my HTA

We are using HTAs to display detailed reporting information (about our automated tests). The HTA can become multiple page lengths. It works great for our users, but I have a usability issue: When a user has scrolled to a certain position in the report (say, teststep 42) and the user maximizes or resizes the HTA window, the user looses his current position in the report (he had jumped to teststep 32 for example) and has to scroll to the correct position again.

How can I fix the page position, so resizing the HTA window does not affect it开发者_C百科?

I know, it is possible to use min-width etc. but the layout of the HTA is mend to vary in size and/or wrapping around the corner. The only thing I want is that the same information is directly visible on the screen after resizing. Is that possible?


You should be able to use the scrollTop property of an element to know how far someone has scrolled down in the page.

Use the onscroll event of the containing div element to record the value of that property each time scrolling occurs.

Then use some sort of "after resize" event to set the scrollTop property to the last recorded value. I haven't tracked down which event does this yet, but I'm sure there is something that will work.


I suggest you make the hta window unresizable.

<HTA:APPLICATION ID="Roll"
    APPLICATIONNAME="Roll" 
    BORDER="dialog"
    MAXIMIZEBUTTON="no"
    SCROLLFLAT="yes"
    CAPTION="yes"
    SELECTION="no"
    INNERBORDER="no"
    ICON=""
    SCROLL="no"
    SHOWINTASKBAR="yes"
    SINGLEINSTANCE="yes"
    SYSMENU="yes"
    WINDOWSTATE="normal" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜