Email conversation
From | Sandro Bariatti |
To | Me |
Subject | problem with perfect popups script |
Date | 18 April 2006 19:01 |
Hi,
my name is Sandro and i have a little problem with your perfect popup
script.
I'm developing a my own web application using jsp, tomcat and IE (5.5 or 6 )
and on the
window.open ( ... .... width=xxx, height=xxx ... )
i have this:
if the content (dinamically load from a db) is greater than the value of
width and height, than the popup resize correctly;
if the value of width is greater than the width content (and the height
value is smaller than the height content) than the popup resize only the
height;
if the value of height is greater than the height content (and the width
value is smaller than the width content) than the popup resize correctly;
if the value of width and height are greater than the width and height
content than the popup resize resize only the height;
why ? in your perfectpopups.html you write that initial height/width are not
important.
but
this is a very little problem when i have a single popup (i set little width
and height ;-) );
but i have the seguent map:
main window ---> popup (that must resize its content) ---> other page in the
same popup ( that must resize its content too) ---> etc etc.
in this case i open the first popup correctly ( i set a small width and
height property) but at the next page the popup became very long
and small ( width=1000, height=80); when i push my button <<back>> for
return on my first popup, the popup resize only the height.
Can you help me please ?
i tried to reduce to 100, 100 the size of the window before to fit the
content but with no success (i'm a js beginner ;-(( )
I'm using win Xp pro sp2 and IE 6.0.2900.2180. ..... my resolution is 1024
x 768.
in a jsp i write:
<title><bean:message key="logon.title"/></title>
<link href="<%=appPath%>/style/app.css" rel="stylesheet"
content-type="text/css">
<script language="JavaScript1.2">
..
..
..
<<your perfectpopups script>>
</script>
and i used <body onload="resizeWinTo('mydiv')"> or a final script after the
tag body ( when the onload fail ):
</body>
<script language="JavaScript1.2">
resizeWinTo('mydiv')
</script>
an example of code for call the popup is:
function goTraffic() {
keyfield = getSelected( )
if (keyfield == "") { alert("<bean:message key="message.element"/>");
return }
var field = keyfield.substring(keyfield.indexOf("=")+1)
var chiaveField = chiave[field].split("|")
var traffic =
"<%=appPath%>/Alarm/trafficFilter.do?CASES.caseId="+field+"&referencedate="+
chiaveField[0]
var cou =
window.open(traffic,"con","resizable=yes,scrollbars=yes,status=no,toolbar=no
,width=100,height=200,top=50,left=50")
}
Excuse me my bad english ....
Its a very very cool site, many many compliments !!!!!
Sandro.
From | Me |
To | Sandro Bariatti |
Subject | Re: problem with perfect popups script |
Date | 20 April 2006 17:44 |
Sandro,
> my name is Sandro and i have a little problem with your perfect popup
> script.
Which version of the script are you using, and what options are you using?
Is it for plain text, or images, etc?
> if the value of width is greater than the width content (and the height
> value is smaller than the height content) than the popup resize only the
> height;
Please check in Opera and Firefox, and tell me what both of them do:
http://www.opera.com/download/
http://www.mozilla.com/
> why ? in your perfectpopups.html you write that initial height/width are
> not important.
the inital height and width of the popup itself are not important, since the
script (normally) does not use those. The height and width of the popup
contents _is_ important.
> var traffic = "<%=appPath%> ...
I do not know the programming language you are
using here, so I do not know exactly what you are putting into the popup. I
need to see the resulting code.
Please give me the address of a demonstration page where I can see the bug
for myself
Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
From | Sandro Bariatti |
To | Me |
Subject | Re: problem with perfect popups script |
Date | 21 April 2006 17:18 |
Attachment | demo |
Hi and many thanks for your answer.
i have in part discover the problem:
i used this script version:
function resizeWinTo( idOfDiv ) {
var oH = getRefToDivMod( idOfDiv ); if( !oH ) { return false; }
var oW = oH.clip ? oH.clip.width : oH.offsetWidth;
var oH = oH.clip ? oH.clip.height : oH.offsetHeight;
if( !oH ) { return false; }
var x = window; x.resizeTo( oW + 200, oH + 200 );
var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;
if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }
else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }
else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }
if( window.opera && !document.childNodes ) { myW += 16; }
x.resizeTo( oW + ( ( oW + 200 ) - myW ), oH + ( (oH + 200 ) - myH ) );
}
instead of that for Resizing the popups to fit non-image content of unknown
width
in attach 3 html and a css for explain to you my problem:
in first popup all it's ok, but in the second why there is some space in the
bottom of the popup ? (also in firefox)
same result also if i replace the"<body onload= ..." with the script at the
end of the page (pop2.html)
(it's better the <body onload ....> or the script at the and of the page ?
)
but if i replace (in pop2.html) the piece:
<table align="center" cellpadding="3" cellspacing="0">
...
...
</table>
with:
<table align="center" cellpadding="3" cellspacing="0">
<tr>
<td align="left" nowrap>AAAAAAAAA</td>
<td><input type="text" name="vcasesview.alarmOwner" size="30"
value="0039335648116" disabled="disabled"></td>
<td align="left" nowrap>AAAAAAAAA</td>
<td><input type="text" name="vcasesview.alarmType" size="30"
value="0039335648116" disabled="disabled"></td>
<td align="left" nowrap>AAAAAAAAA</td>
<td><input type="text" name="vcasesview.alarmOwner" size="30"
value="0039335648116" disabled="disabled"></td>
<td align="left" nowrap>AAAAAAAAA</td>
<td><input type="text" name="vcasesview.alarmOwner" size="30"
value="0039335648116" disabled="disabled"></td>
</tr>
<tr>
<td align="left" nowrap>Sssssssssss</td>
<td><input type="text" name="vcasesview.signalname" size="30"
value="aadasasass" disabled="disabled"></td>
<td align="left" nowrap>Sssssssssss</td>
<td><input type="text" name="vcasesview.signalsource"
value="aadasasass" size="30" disabled="true"></td>
<td align="left" nowrap>Sssssssssss</td>
<td><input type="text" name="vcasesview.signalname" size="30"
value="aadasasass" disabled="disabled"></td>
<td align="left" nowrap>Sssssssssss</td>
<td><input type="text" name="vcasesview.signalname" size="30"
value="aadasasass" disabled="disabled"></td>
</tr>
</table>
for "create" a small - long popup, the space in bottom is disappeared ...
:-S ... Why ?
Many thanks and a very good weekend !!
I can't use mozilla or opera because this application has many script that
run correctly only in IE and i can't rewrite all ...
Sandro
From | Me |
To | Sandro Bariatti |
Subject | Re: problem with perfect popups script |
Date | 22 April 2006 11:21 |
Sandro,
> in attach 3 html and a css for explain to you my problem:
> in first popup all it's ok, but in the second why there is some space in
> the bottom of the popup ?
This is because the popup exceeds the available space in the desktop (and
remember that the resizing routine needs about 200 pixels more in both
directions). There is too much content. The version of the script that you
are using is not designed to cope with that much content. Some of the
image-only versions are, but they are not appropriate. Unfortunately, I
could not find a useful way to deal with your situation.
The reason it always leaves a gap at the bottom and not the side is because
you did not restrict the width of the div (Notice that in my example I set a
width on the div).
> I can't use mozilla or opera because this application has many script that
> run correctly only in IE and i can't rewrite all ...
The example you sent could be tested in all of them. But more importantly, I
sincerely hope this application is restricted to a controlled intranet only,
instead of polluting the real Web. But still, restricting yourself, and your
company to a bad browser and a single operating system does not do you any
good at all in the future. For the sake of your future browsing needs, when
your company realises that the other browsers are better and decides to
switch, rewrite your application now while it is still in development, and
save yourself the time later.
From | Sandro Bariatti |
To | Me |
Subject | Re: problem with perfect popups script |
Date | 24 April 2006 14:34 |
Thank you very much for your answers and suggestions;
you are a very beautiful person !!
Bye
Sandro.