Note that there are some explanatory texts on larger screens.

plurals
  1. POWebkit JQuery Mobile block to inline Transition Not Functioning
    primarykey
    data
    text
    <p>I'm tying to get an orientation change to work on the mobile browsers. When the orientation changes the div "wrapStat" is supposed to change between inline and block display. </p> <p>This complete block of text is replaced every X seconds by an ajax call so putting a style on the wrapStat class itself will not work. I'm changing the parent #CustomStats class between portraitCustomStats and landscapeCustomStats depending on the orientation. </p> <p>This works in Firefox (resizing the browser will flip the orientation flag) but does not work in any webkit browser until the ajax call fires.</p> <p>Is there a problem with webkit and dynamically changing inline and block styles?</p> <p>css:</p> <pre><code>.portraitCustomStats .StatsRow .wrapStat { display: block !important; } .landscapeCustomStats .StatsRow .wrapStat { display: inline !important; } </code></pre> <p>javascript:</p> <pre><code>$(window).bind('orientationchange', function (anOrientationEvent) { if ($(window).width() &gt; 600) return; $("#CustomStats").attr("class", anOrientationEvent.orientation.toLowerCase() + "CustomStats").trigger("updatelayout"); }); </code></pre> <p>HTML:</p> <pre><code>&lt;span id="CustomStats" class="portraitCustomStats"&gt; &lt;tr class="StatsRow"&gt; &lt;td class="description"&gt;Unique Visitors&lt;/td&gt; &lt;td class="stat"&gt; &lt;span class="UniqueVisitors"&gt; &lt;strong&gt; &lt;div class="wrapStat"&gt; &lt;span class="pastStat"&gt;(1,318)&lt;/span&gt; &lt;img src="../../Images/up_arr.gif" alt="increase"&gt; &lt;span class="increasedStat"&gt;85.43%&lt;/span&gt; &lt;/div&gt; &lt;/span&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/span&gt; </code></pre> <p>Here is the jsFiddle of the code actually not working...</p> <p><a href="http://jsfiddle.net/Hupperware/43eK8/5/" rel="nofollow">http://jsfiddle.net/Hupperware/43eK8/5/</a></p> <p>Mobile view: <a href="http://jsfiddle.net/m/rat/" rel="nofollow">http://jsfiddle.net/m/rat/</a></p> <p>This works in Firefox (text turns red in "landscape" and blue in "portrait" just so you know it's working). In FF it will show inline and block as you go between a wider view and a narrow view...</p> <p>In Webkit (Safari and Chrome) it will not...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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