根据手机屏幕的旋转,调整图片

function exchangeWindow(){
        if(window.orientation == 0)
        {
            $('#helpimg').attr("src","/images/road/help_0.jpg");
        }
        else{
            $('#helpimg').attr("src","/images/road/help_90.jpg");
        }
    }
    window.addEventListener("orientationchange",function(obj){
        exchangeWindow();
    });

 

posted @ 2014-09-18 22:19  梦醒心晴  Views(184)  Comments(0Edit  收藏  举报