I do not think that there are events that fire when the phone goes to the landscape for a portrait. However, you can write a custom function to find out the current orientation. Write the following code in the window.resize event.
$(window).resize( function(){ var height = $(window).height(); var width = $(window).width(); if(width>height) { // Landscape $("#img").attr("src","landscapeurl"); } else { // Portrait $("#img").attr("src","portraiturl"); } });
code here
source share