Position Page at 0,0 on screen

Workarounds and usability notes.

Position Page at 0,0 on screen

Postby John Robin Dove » Thu Jun 23, 2016 3:50 am

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.
John Robin Dove
 
Posts: 486
Joined: Thu Jan 23, 2014 4:35 am

Re: Position Page at 0,0 on screen

Postby Clifton » Thu Jun 23, 2016 7:12 am

Works for me.
Image 1.png
setPageContentPosition() parameters to set page at 0, 0
Image 1.png (12.55 KiB) Viewed 613 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.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: Position Page at 0,0 on screen

Postby John Robin Dove » Thu Jun 23, 2016 10:13 am

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?
John Robin Dove
 
Posts: 486
Joined: Thu Jan 23, 2014 4:35 am

Re: Position Page at 0,0 on screen

Postby Clifton » Thu Jun 23, 2016 10:38 am

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 611 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.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: Position Page at 0,0 on screen

Postby John Robin Dove » Thu Jun 23, 2016 11:32 am

Many thanks.
John Robin Dove
 
Posts: 486
Joined: Thu Jan 23, 2014 4:35 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron