×
Namespaces

Variants
Actions

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

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: 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
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.
41 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×