首页 > 代码库 > 根据手机屏幕的旋转,调整图片

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

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();    });

 

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