Hello!
I want to display picture in a new window. For that I wrote javascript function that opens new window. I open window with some fixed size (for example 500 x 500). But I want to resize my window to picture size. For that I attach event to this newly created window. Here is only code for IE because in FF and Chrome all works.
var win = null;
function showPicture(url) {
win = window.open(url, "pic", "height=500,width=500");
if (window.attachEvent) {
win.attachEvent("onload", correctWinSize);
}
// Not IE attach event code
}
function correctWinSize() {
// Here is resize code
}
Problem is that event fires only sometimes. I just click on hyperlink that calls showPicture() and window is sometimes resized and sometimes not. Have you any ideas hot make it work?