Home
TeamSite
Window Size
cheeku
Hi All,
Whenever i am clicking on preview button, my asp page is opening up in standard size.But I want this asp page to open up in maximised window. How can i do this?
Thanx in advance
Find more posts tagged with
Comments
Migrateduser
Sure... first, check to see if the user has opted to "preview" or "generate" the page (I'm extracting from your description that you're interested in doing this on PREVIEW). The following IF statement takes care of that:
if (iwpt_get_flag_param('-oprefix') eq 'preview') { ... }
Next, you'll need to output some JavaScript if the above condition is met. Play around with properties like "screen.height", "screen.width", "self.height", and "self.width". "Screen" deals with the user's resolution and "self" describes the properties of the browser window, itself. There are some tricks like allowing 20px on each side for the margin or gutter of the web browser, but using the four properties above, you should be good.
Dave
Environments:
(1,2) TS6.5, TS6.5SP1 on W2K3
(3) Vignette V7 Portal on Solaris 9
jbonifaci
I just always use:
window.moveTo(0,0);
window.resizeTo(screen.width,screen.height);
You can play around with it, as Dave said, by subtracting some pixels from each of the values to get it to the size you want. But you definitely only want to do this if it is a preview, not for generate, as Dave pointed out.
~Jeff
Migrateduser
Ooh, that's pretty sweet, actually. Yeah, I guess I would have done that in like 4 or 5 lines but that accomplishes it in 2! Good job, Jeff.
Thanks,
Dave
Environments:
(1,2) TS6.5, TS6.5SP1 on W2K3
(3) Vignette V7 Portal on Solaris 9
jbonifaci
Actually, this is slightly better:
window.moveTo(0,0);
window.resizeTo(screen.availWidth,screen.availHeight);
With this you shouldn't need to play around with adding/subtracting pixels.
~Jeff
Migrateduser
Nice, but availHeight and availWidth are implemented in JS 1.2, so there might be some browser compatibility issues.
Environments:
(1,2) TS6.5, TS6.5SP1 on W2K3
(3) Vignette V7 Portal on Solaris 9
jbonifaci
Yeah, but you could probably do something like this:
function resizeWindow()
{
window.moveTo(0,0);
if (screen.availWidth)
{
window.resizeTo(screen.availWidth,screen.availHeight);
}
else
{
window.resizeTo(screen.width,screen.height);
}
}
~Jeff