WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

IE7 window.open and resizeby problem

 
   Home -> Office other -> Programming RSS
Next:  Programming: FP Site Help  
Author Message
Mike McCollister

External


Since: Jun 20, 2008
Posts: 3



(Msg. 1) Posted: Fri Jun 20, 2008 10:08 pm
Post subject: IE7 window.open and resizeby problem Add to elertz
Archived from groups: microsoft>public>frontpage>programming (more info?)

I have a JavaScript function that I use to open up an image in a popup
window when someone clicks on an image. It works fine in IE6 but in IE7 when
I try to do a resizeBy to resize the window due to the scrollbar height the
image does not come up sometimes. Does anyone know how to fix this?

I've included my function. below.

Thanks,

Mike

function DisplayImage(image, width, height, title, date)
{
var newWin;
var winName;
var title2 = unescape(title);
var newTitle = title2;
var newDate;
var ieVersion = GetInternetExplorerVersion();

html = "";

title2 = "some code remove here";

html += "<html>" + endl;
html += "<head>" + endl;
html += "<title>" + newTitle + ": " + newDate + "</title>" + endl;
html += "</head>" + endl;
html += "<script>" + endl;
html += "function PlaySound(url) {html += document.all.sound.src =
url;}";
html += "</script>" + endl;
html += "<body bgcolor='#FFFFFF' topmargin='0' leftmargin='0' " +
"marginheight='0' marginwidth='0'>" + endl;
html += "<p align='center'>" + endl;
html += "<a href='javascript:window.close()'>" +
"<img src='" + imageDir + "/" + image + "' width='" + width +
"' height='" + height + "' alt='' " +
"title='Click to Close Window' border='0'></a>" + endl;
html += "</p>" + endl;
html += "<font face='Arial'>" + endl;
html += "<p align='center'><b>" + title2 + "</b><br>" + endl;
html += date + "</p><p></p>" + endl;
html += "</font>" + endl;
html += "</body>" + endl;
html += "</html>";

newWin = window.open("", "photoWindow", //winName,
"width=" + width +
",height=" + height +
",menubar=yes" +
",resizable=yes" +
",scrollbars=yes",
true);

// resize window only for Microsoft Internet Explorer
if(navigator.appName == "Microsoft Internet Explorer")
{
// ???? PROBLEMS HERE IN IE7 ?????
if((ieVersion >= 4) && (ieVersion <= 6))
{
// I don't know why this needs to be done
newWin.document.writeln("<html><body></body></html>");

// do the resize
newWin.resizeBy(width - newWin.document.body.clientWidth,
height - newWin.document.body.clientHeight);
}
}

newWin.document.writeln(html);
newWin.document.close();
newWin.focus();
}
Back to top
Login to vote
Stefan B Rusynko

External


Since: Oct 11, 2003
Posts: 12498



(Msg. 2) Posted: Sat Jun 21, 2008 4:26 am
Post subject: Re: IE7 window.open and resizeby problem Add to elertz [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

And what happen if you change the line to
if((ieVersion >= 4) && (ieVersion <= 7))

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


"Mike McCollister" <MikeMcCollister_DELETEME_ DeleteThis @hotmail.com> wrote in message news:uyMwIP00IHA.552@TK2MSFTNGP06.phx.gbl...
|I have a JavaScript function that I use to open up an image in a popup
| window when someone clicks on an image. It works fine in IE6 but in IE7 when
| I try to do a resizeBy to resize the window due to the scrollbar height the
| image does not come up sometimes. Does anyone know how to fix this?
|
| I've included my function. below.
|
| Thanks,
|
| Mike
|
| function DisplayImage(image, width, height, title, date)
| {
| var newWin;
| var winName;
| var title2 = unescape(title);
| var newTitle = title2;
| var newDate;
| var ieVersion = GetInternetExplorerVersion();
|
| html = "";
|
| title2 = "some code remove here";
|
| html += "<html>" + endl;
| html += "<head>" + endl;
| html += "<title>" + newTitle + ": " + newDate + "</title>" + endl;
| html += "</head>" + endl;
| html += "<script>" + endl;
| html += "function PlaySound(url) {html += document.all.sound.src =
| url;}";
| html += "</script>" + endl;
| html += "<body bgcolor='#FFFFFF' topmargin='0' leftmargin='0' " +
| "marginheight='0' marginwidth='0'>" + endl;
| html += "<p align='center'>" + endl;
| html += "<a href='javascript:window.close()'>" +
| "<img src='" + imageDir + "/" + image + "' width='" + width +
| "' height='" + height + "' alt='' " +
| "title='Click to Close Window' border='0'></a>" + endl;
| html += "</p>" + endl;
| html += "<font face='Arial'>" + endl;
| html += "<p align='center'><b>" + title2 + "</b><br>" + endl;
| html += date + "</p><p></p>" + endl;
| html += "</font>" + endl;
| html += "</body>" + endl;
| html += "</html>";
|
| newWin = window.open("", "photoWindow", //winName,
| "width=" + width +
| ",height=" + height +
| ",menubar=yes" +
| ",resizable=yes" +
| ",scrollbars=yes",
| true);
|
| // resize window only for Microsoft Internet Explorer
| if(navigator.appName == "Microsoft Internet Explorer")
| {
| // ???? PROBLEMS HERE IN IE7 ?????
| if((ieVersion >= 4) && (ieVersion <= 6))
| {
| // I don't know why this needs to be done
| newWin.document.writeln("<html><body></body></html>");
|
| // do the resize
| newWin.resizeBy(width - newWin.document.body.clientWidth,
| height - newWin.document.body.clientHeight);
| }
| }
|
| newWin.document.writeln(html);
| newWin.document.close();
| newWin.focus();
| }
|
|
Back to top
Login to vote
Mike McCollister

External


Since: Jun 20, 2008
Posts: 3



(Msg. 3) Posted: Sat Jun 21, 2008 5:51 am
Post subject: Re: IE7 window.open and resizeby problem Add to elertz [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

The window will open and size correclty but the second and third times the
window will fill the whole screen.

Mike

"Stefan B Rusynko" <sbr_enjoy RemoveThis @hotmail.com> wrote in message
news:uBYQQi30IHA.5944@TK2MSFTNGP04.phx.gbl...
> And what happen if you change the line to
> if((ieVersion >= 4) && (ieVersion <= 7))
>
> --
>
> _____________________________________________
> SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
> "Warning - Using the F1 Key will not break anything!" (-;
> _____________________________________________
>
>
> "Mike McCollister" <MikeMcCollister_DELETEME_ RemoveThis @hotmail.com> wrote in
> message news:uyMwIP00IHA.552@TK2MSFTNGP06.phx.gbl...
> |I have a JavaScript function that I use to open up an image in a popup
> | window when someone clicks on an image. It works fine in IE6 but in IE7
> when
> | I try to do a resizeBy to resize the window due to the scrollbar height
> the
> | image does not come up sometimes. Does anyone know how to fix this?
> |
> | I've included my function. below.
> |
> | Thanks,
> |
> | Mike
> |
> | function DisplayImage(image, width, height, title, date)
> | {
> | var newWin;
> | var winName;
> | var title2 = unescape(title);
> | var newTitle = title2;
> | var newDate;
> | var ieVersion = GetInternetExplorerVersion();
> |
> | html = "";
> |
> | title2 = "some code remove here";
> |
> | html += "<html>" + endl;
> | html += "<head>" + endl;
> | html += "<title>" + newTitle + ": " + newDate + "</title>" + endl;
> | html += "</head>" + endl;
> | html += "<script>" + endl;
> | html += "function PlaySound(url) {html += document.all.sound.src =
> | url;}";
> | html += "</script>" + endl;
> | html += "<body bgcolor='#FFFFFF' topmargin='0' leftmargin='0' " +
> | "marginheight='0' marginwidth='0'>" + endl;
> | html += "<p align='center'>" + endl;
> | html += "<a href='javascript:window.close()'>" +
> | "<img src='" + imageDir + "/" + image + "' width='" + width +
> | "' height='" + height + "' alt='' " +
> | "title='Click to Close Window' border='0'></a>" + endl;
> | html += "</p>" + endl;
> | html += "<font face='Arial'>" + endl;
> | html += "<p align='center'><b>" + title2 + "</b><br>" + endl;
> | html += date + "</p><p></p>" + endl;
> | html += "</font>" + endl;
> | html += "</body>" + endl;
> | html += "</html>";
> |
> | newWin = window.open("", "photoWindow", //winName,
> | "width=" + width +
> | ",height=" + height +
> | ",menubar=yes" +
> | ",resizable=yes" +
> | ",scrollbars=yes",
> | true);
> |
> | // resize window only for Microsoft Internet Explorer
> | if(navigator.appName == "Microsoft Internet Explorer")
> | {
> | // ???? PROBLEMS HERE IN IE7 ?????
> | if((ieVersion >= 4) && (ieVersion <= 6))
> | {
> | // I don't know why this needs to be done
> | newWin.document.writeln("<html><body></body></html>");
> |
> | // do the resize
> | newWin.resizeBy(width - newWin.document.body.clientWidth,
> | height - newWin.document.body.clientHeight);
> | }
> | }
> |
> | newWin.document.writeln(html);
> | newWin.document.close();
> | newWin.focus();
> | }
> |
> |
>
>
Back to top
Login to vote
Display posts from previous:   
       Home -> Office other -> Programming All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
 Office
  Office Other
 Security
 WinRAR
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET