Namespaces
Variants
Actions

Archived:OnResize event in Symbian Web Runtime does not fire on Nokia 5800 (Known Issue)

Jump to: navigation, search
Archived.png
Archived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

The article is believed to be still valid for the original topic scope.


Article Metadata

Tested with
Devices(s): Nokia 5800 XpressMusic sw. 10.0.010

Compatibility
Platform(s): S60 5th Edition

Article
Keywords: onResize
Created: User:Technical writer 1 (24 Feb 2009)
Last edited: hamishwillee (01 Aug 2012)

Description

Window.onResize event is not received by Web Runtime Widgets on Nokia 5800 XpressMusic with sw 10.0.010. These events should occur when the screen orientation is changed.

How to reproduce

Have a function launch on Window.onResize. Nothing happens.

Solution

This issue has been fixed from sw 11.0.008 onwards.

Workaround:

  window.onload = init; //set up events etc...
window.onresize = checkOrientation; // support for the regular function
var previousHeight = window.innerHeight; // record the current height
 
function init(){
// Heading of the test application
var header = document.getElementById("heading_txt");
header.innerHTML ="User agent tester";
var txt = document.getElementById("text_txt");
 
//This is the actual code
var usrAgnt = navigator.userAgent;
if(usrAgnt.match("10.0.010")=="10.0.010"){
//No support for window.onresize, therefore polling
setInterval("checkOrientation()", 500);
txt.innerHTML = "onResize is NOT supported";
}else{
//onResize is supported
txt.innerHTML = "onResize IS supported";
}
}
 
//The function that get's called when screen orientation is switch
function checkOrientation(){
if(window.innerHeight != previousHeight){
previousHeight = window.innerHeight;
if(window.innerHeight > 360){
//Switch to portrait here
alert("Resize to portrait");
}else{
//Switch to landscape here here
alert("Resize to landscape");
}
}
This page was last modified on 1 August 2012, at 07:41.
263 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved