Page 1 of 1

Position Page at 0,0 on screen

PostPosted: Thu Jun 23, 2016 3:50 am
by John Robin Dove
Hi Clifton,

I am using some js code to create a Skype-like application. This functions quite well but I want add a full screen function. I think I can do this by getting the screen size and resizing the (modified) HTML 5 video object accordingly. The object is displayed in a TB field using pgGotoURL. I can move this field to 0,0 on the page and enlarge it as necessary but how can I move the page to 0,0 in the browser window? I expected to be able to do this using setPageContentPosition but so far I haven't succeeded and the page remains centered. Maybe I'm missing something.

Re: Position Page at 0,0 on screen

PostPosted: Thu Jun 23, 2016 7:12 am
by Clifton
Works for me.
Image 1.png
setPageContentPosition() parameters to set page at 0, 0
Image 1.png (12.55 KiB) Viewed 624 times

NOTE: You cannot use setPageContentPosition() on load book because there is no loaded page. It is designed to be used anywhere else in the structure of your application. Plus you only need to call the function once and the page will stay fixed at the position set by the function. If you need to change it back to centered or something else, you can run it again.

Re: Position Page at 0,0 on screen

PostPosted: Thu Jun 23, 2016 10:13 am
by John Robin Dove
Thanks Clifton,
This was actually one of the things I meant to try but I forgot about it. I have been trying with "@0" instead of 0. I should have read more carefully. Your instructions say optional integer of String "'@#". What would "@0" be used for?

Re: Position Page at 0,0 on screen

PostPosted: Thu Jun 23, 2016 10:38 am
by Clifton
The string "@#" forces the resizing in the browser to never let the browser window move an auto-sized window less than # pixels left or top.
So settings like these . . .
Image 1.png
Set min top/left page positions using setPageContentPosition()
Image 1.png (12.74 KiB) Viewed 622 times
. . . would maintain AT LEAST a position top and left of 24 pixels regardless of how the browser window is resized. Otherwise it will gracefully allow the window to be centered.

Re: Position Page at 0,0 on screen

PostPosted: Thu Jun 23, 2016 11:32 am
by John Robin Dove
Many thanks.