Welcome to WebmasterWorld Guest from 54.147.158.28

Forum Moderators: open

Message Too Old, No Replies

Opera and Resize Event

Forcing Opera to reload on resize

     

gph

3:42 am on Feb 4, 2002 (gmt 0)

Full Member

10+ Year Member

joined:Jan 31, 2002
posts:285
votes: 0


Is it possible to get opera to reload when the window is resized?
4:05 am on Feb 4, 2002 (gmt 0)

Administrator from US 

WebmasterWorld Administrator brett_tabke is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Sept 21, 1999
posts:38063
votes: 13


nope.

gph

4:20 am on Feb 4, 2002 (gmt 0)

Full Member

10+ Year Member

joined:Jan 31, 2002
posts:285
votes: 0


Thanks Brett, I've been searching all night for this info. I'll just have to live with this minor shortcoming in Opera.
4:31 am on Feb 4, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 10, 2001
posts:748
votes: 0


Brett is referring to the resize event, not supported, however, you can roll your own. Set up a timer with this kind of stuff in JS.

window.onload = yourstartupstuff;

function yourstartupstuff() {
checkresize();
}

var origW=window.innerWidth;
var origH=window.innerHeight;
var chkresizetimer;

function checkresize() {
var newW=window.innerWidth;
var newH=window.innerHeight;
if (newW==origW && newH==origH){
chkresizetimer = setTimeout("checkresize()",200);
}
else {
clearTimeout(chkresizetimer);
window.location.reload();
}
}

gph

4:52 am on Feb 4, 2002 (gmt 0)

Full Member

10+ Year Member

joined:Jan 31, 2002
posts:285
votes: 0


awesome, thank you, it works perfectly.

I'm curious as to how this is browser specific? If I take onResize="history.go(0)" out of the body tag the script works for NN 6 and NN 4.74 but not for IE 6.

I'm not complaining, the script and body tag work perfectly in the browsers I have including Opera 6, just curious.

5:19 am on Feb 4, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 10, 2001
posts:748
votes: 0


Use
document.body.clientHeight
document.body.clientWidth

for IE.

instead of the innerHeight innerWidth stuff. Or just leave the onResize in your body tag. I could be wrong but I think only IE supports it?

I found this site on google:
[xs4all.nl...]

Maybe helpful.

gph

5:30 am on Feb 4, 2002 (gmt 0)

Full Member

10+ Year Member

joined:Jan 31, 2002
posts:285
votes: 0


Thanks, I was searching with google but obviously with the wrong criteria.
6:41 am on Feb 4, 2002 (gmt 0)

Administrator from US 

WebmasterWorld Administrator brett_tabke is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Sept 21, 1999
posts:38063
votes: 13


I believe that will work in SDI mode, but not in MDI mode.

gph

7:08 am on Feb 4, 2002 (gmt 0)

Full Member

10+ Year Member

joined:Jan 31, 2002
posts:285
votes: 0


Brett, please excuse my ignorance, what is SDI mode and MDI mode?
7:17 am on Feb 4, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 10, 2001
posts:748
votes: 0


Actually, it only seems to work only once; in other words, after the first reload, the timer is turned off.

I double checked it. I was testing in opera 5.12, and sure enough, it works. But if you do it again, (resize), it stops working. It's as if the timer stopped working or something or needs to be reset in a different manner.

As far as version 6, I really don't think MDI, SDI has anything to do with it. In windows, a window is a window. Where its placed is based upon its parent. (Brett, we had this discussion once before-popup windows just need one bit set in WIN32 to keep them from being resized - I'll stand by that, no matter what opera software tells you) MDI and SDI just refer to the number of documents and the parent window and who owns it. What happens to that window is just a function of the code inside. If SDI and MDI don't act the same with windowing functions as far as resizing, etc., then that's a bug. But I can't verify whether or not that code works or not for op6 because I can't tell whether it is reloading here or just checking its cache on my test page.

The only reason I have used the opera resize code is because of problems with a resize in 5.12 using CSS (just like NN4). I haven't really tested v6 enough yet. But in 5.12, there's really no problem on the first resize: but it seems like the second one never happens. And it looks to me like the timer code being reset turns the whole function off.

I'll test it some more...

7:28 am on Feb 4, 2002 (gmt 0)

Administrator from US 

WebmasterWorld Administrator brett_tabke is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Sept 21, 1999
posts:38063
votes: 13


Well, the MDI in opera is a proprietary implimentation as far as I know. The whole windowing action is different from any other MDI program I've ever used. (If I recall correctly, you can return to standard MDI action with "classicMDI=1" in the [userprefs] section of the ini. I'm not sure if that is still supported in 6.0).

>SDI mode and MDI mode?

Single Document Interface. Mono windows like IE where every new window spawns new toolbars, menus, and places a button on the windows task bar.
Multi Document Interface. Where there is only one main window with "unlimited" child windows.

When you start Opera you are given the option as to which one you want to use. In Operas SDI mode there are also "tabs" where you can load pages into "tabs".

Popups act differently in Opera depending on whether you are in sdi or mdi mode. You can force 'no resize' in sdi, but not in Opera's native mdi mode.