Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I did some testing and wasn't able to reproduce the problem. Have you tried testing the mobile debugging feature on jsfiddle?</p> <p>I put together the following simple example.</p> <p>HTML:</p> <pre><code>&lt;body&gt; &lt;div id="changeMe"&gt;Hello World&lt;/div&gt; &lt;/body&gt; </code></pre> <p>CSS:</p> <pre><code>.portrait { display: block !important; } .landscape { display: inline !important; } #changeMe { color: blue; } </code></pre> <p>Javascript:</p> <pre><code>$(document).ready(function() { $('body').on('orientationchange', function() { console.log('updated orientation: ' + window.orientation); if (window.orientation == 0) { // portrait mode $('#changeMe').removeClass('landscape').addClass('portrait').text('Portrait Mode'); } else { // landscape mode $('#changeMe').removeClass('portrait').addClass('landscape').text('Landscape Mode'); } }); });​ </code></pre> <p>Here is a link to the working jsfiddle: <a href="http://jsfiddle.net/gizmovation/9ALTU/" rel="nofollow">http://jsfiddle.net/gizmovation/9ALTU/</a></p> <p>When you use the mobile debugging feature (the little wifi looking icon next to the run button), you can open the page on your iphone while simultaneously debugging on your PC. When I did this, I was able to see that the block and inline styles were toggling properly on the #changeMe div. This should work regardless of whether the content was loaded via ajax.</p> <p>Hope this helps and that you are able to use the mobile debugger to resolve your issue.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload