My web application needs to support orientation feature.I put the code like this
- (function(){
- var init = function() {
- var updateOrientation = function() {
- var orientation = window.orientation;
- switch(orientation) {
- case 90: case -90:
- orientation = 'landscape';
- break;
- default:
- orientation = 'portrait';
- }
- // set the class on the HTML element (i.e. )
- document.body.parentNode.setAttribute('class', orientation);
- };
- // event triggered every 90 degrees of rotation
- window.addEventListener('orientationchange', updateOrientation, false);
- // initialize the orientation
- updateOrientation();
- }
- window.addEventListener('DOMContentLoaded', init, false);
- })();
and in my config.xml : <tizen:setting screen-orientation="portrait" contextmenu="enable"/>
and I aslo tried like :<tizen:setting contextmenu="enable"/>
Neither works well,it can't detect the event of orientationchange .Souds like bind event failed.