popup open problem only with firefox

G

Gérard Talbot

ASM wrote :
Gérard Talbot said:
ASM wrote :


[snip]

(Following = something about popup focus)
Yes, you're right and I understand what you mean... but what if it
uses the same values?


I have to considere uses can be different from call to call
If not, width and height parameters have no sens
(no utility in function calls)
The thing is that the code makes no distinction, is not smart enough
to deal with such cases. One way is to store the href value, width and
height values in 3 global variables


A so usual and simple popup would really need more JS work with global
variables ?
and then to compare in the function. It's a bit more complicated. If
the webpage requirements are there, then this would be justified code.


I think popup focus in end of code would have to exist if there is a
possbility it allready does exists.


Right. If it already exists and if it uses the same parameters
In this case a window resizing would before hapen in the function.

Not reliable. Most alternative browsers now allow users to disable move
and resize script functions.
But it seems that some browsers don't resize windows ?
(in same way as others)

then store the parametrs in global variables between calls and compare
with current parameters. You then avoid all calls to moveTo, resizeTo.

E.g. the function OpenRequestedPopup(strUrl) which reuses and recycles a
single secondary window at this page:

http://www.gtalbot.org/BrowserBugsSection/MSIE6Bugs/

It also gives an example of scalable positioning of the window within
the available space for applications.
i.e

function pop(page,width,height) {
var margh = screen.availHeight? screen.availHeight : screen.height;
margh = (margh-height)/2-30;

Why - 30? screen.availHeight already considers the height of the windows
task bar and the height of any semi-permanent os-dependent
applications (like MS-Office quick launch bar, MS-magnify, etc). The
window taskbar could be higher than 30 too. Some people (rare but it
happens) likes to have the window taskbar at the top. Personally, I like
having a 64px high window taskbar because I have many icons in the quick
launch bar.
var margl = screen.availWidth? screen.availWidth : screen.width;
margl = (margl-width)/2-10;

Same here. screen.availWidth considers the width of any semi-permanent
os-dependent applications on the desktop. So, screen.availWidth is the
reliable width that a browser window can safely use. In some countries
where text is read from right to left, the window taskbar is on the left
side.
if(!(!truc) || !truc.closed) '';

This instruction above seems suspicious...
else truc = window.open('','','resizable=1,scrollbars=1');
with(truc) {
location.href = page;
resizeTo(width,height);

resizeTo and moveTo can be neutralize in a large number of browsers
(Opera 7+, Mozilla-based).
moveTo(margl,margh);
focus();
}
}

Gérard
 
A

ASM

Gérard Talbot said:
ASM wrote :


Why - 30? screen.availHeight already considers the height of the windows
task bar and the height of any semi-permanent os-dependent applications

Who did speak about window ? -> SCREEN.availHeight

so : -30 for the naked browser's window top marge
to leave space to browser's window titlebar and some security
(some browsers don't accept to hide the statusbar)
(like MS-Office quick launch bar, MS-magnify, etc). The window taskbar
could be higher than 30 too.

don't know what about you talk :
isn't it included in screen.availHeight ? (Windows taskbar, Mac menubar)

but, because I do no trust in window.availSizes, I keep fiew space for
the browser's window bars of lifts
Some people (rare but it happens) likes to
have the window taskbar at the top. Personally, I like having a 64px
high window taskbar because I have many icons in the quick launch bar.


Same here. screen.availWidth considers the width of any semi-permanent
os-dependent applications on the desktop. So, screen.availWidth is the
reliable width that a browser window can safely use. In some countries
where text is read from right to left,

not only ... it's a free choice of user (I think ... no PC win by here)
the window taskbar is on the left
side.

so ... no problemo no ?
This instruction above seems suspicious...

IE is so often crying about non important things
I'd mistake ! :-(

if(!(!truc) || truc.closed) '';
else truc.close();
truc=window.open( blah )
resizeTo and moveTo can be neutralize in a large number of browsers
(Opera 7+, Mozilla-based).

I know. All as blank window or popup (even launched by link or button)

With all these user's preferences setting
what will yet can we do my dear sir?
:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top