Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 在空载时评估方向事件?_Jquery_Orientation_Screen Orientation_Device Orientation - Fatal编程技术网

Jquery 在空载时评估方向事件?

Jquery 在空载时评估方向事件?,jquery,orientation,screen-orientation,device-orientation,Jquery,Orientation,Screen Orientation,Device Orientation,我正在开发一个web应用程序,它要求我根据OrientionEvent更改内容。到目前为止,它工作得很好,在我改变方向的同时改变和设置内容。然而,我需要的方向也在onLoad火灾。这可能吗 $(document).ready(function(){ var onChanged = function() { //TODO: Need to learn a way to fire it at load time if(window.orientation == 90 || windo

我正在开发一个web应用程序,它要求我根据OrientionEvent更改内容。到目前为止,它工作得很好,在我改变方向的同时改变和设置内容。然而,我需要的方向也在onLoad火灾。这可能吗

$(document).ready(function(){
var onChanged = function() { //TODO: Need to learn a way to fire it at load time
        if(window.orientation == 90 || window.orientation == -90){
            $('#nav').html('<b> : LANDSCAPE : </b>');
        }else{
            $('#nav').html('<b> : PORTRAIT : </b>');
        }
        event.stopPropagation();
    }
 $(window).bind(orientationEvent, onChanged);
});
$(文档).ready(函数(){
var onChanged=function(){//TODO:需要学习在加载时启动它的方法
如果(window.orientation==90 | | window.orientation==-90){
$('#nav').html(':scape:');
}否则{
$('#nav').html(':crative:');
}
event.stopPropagation();
}
$(窗口).bind(定向事件,一旦更改);
});
var onChanged=function(){//TODO:需要学习在加载时启动它的方法
如果(window.orientation==90 | | window.orientation==-90){
$('#nav').html(':scape:');
}否则{
$('#nav').html(':crative:');
}
event.stopPropagation();
}
$(文档).ready(函数(){
$(窗口).bind(定向事件,一旦更改);
}).bind(“加载”,一旦更改);
var onChanged=function(){//TODO:需要学习在加载时启动它的方法
如果(window.orientation==90 | | window.orientation==-90){
$('#nav').html(':scape:');
}否则{
$('#nav').html(':crative:');
}
event.stopPropagation();
}
$(文档).ready(函数(){
$(窗口).bind(定向事件,一旦更改);
}).bind(“加载”,一旦更改);
var onChanged = function() { //TODO: Need to learn a way to fire it at load time
        if(window.orientation == 90 || window.orientation == -90){
            $('#nav').html('<b> : LANDSCAPE : </b>');
        }else{
            $('#nav').html('<b> : PORTRAIT : </b>');
        }
        event.stopPropagation();
    }

$(document).ready(function(){
   $(window).bind(orientationEvent, onChanged);
}).bind('load', onChanged);