Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8005021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:05:54+00:00 2026-06-04T17:05:54+00:00

I’m tying to get an orientation change to work on the mobile browsers. When

  • 0

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.

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.

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.

Is there a problem with webkit and dynamically changing inline and block styles?

css:

.portraitCustomStats .StatsRow .wrapStat {
    display: block !important;
}
.landscapeCustomStats .StatsRow .wrapStat {
    display: inline !important;
}

javascript:

$(window).bind('orientationchange', function (anOrientationEvent) {
    if ($(window).width() > 600) return;
    $("#CustomStats").attr("class", anOrientationEvent.orientation.toLowerCase() + "CustomStats").trigger("updatelayout");
});

HTML:

<span id="CustomStats" class="portraitCustomStats">
    <tr class="StatsRow">
      <td class="description">Unique Visitors</td>
        <td class="stat">
          <span class="UniqueVisitors">
            <strong>
            <div class="wrapStat">
              <span class="pastStat">(1,318)</span>
                <img src="../../Images/up_arr.gif" alt="increase">
                <span class="increasedStat">85.43%</span>
            </div>
           </span>
        </td>
    </tr>
</span>

Here is the jsFiddle of the code actually not working…

http://jsfiddle.net/Hupperware/43eK8/5/

Mobile view: http://jsfiddle.net/m/rat/

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…

In Webkit (Safari and Chrome) it will not…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T17:05:57+00:00Added an answer on June 4, 2026 at 5:05 pm

    I believe I’ve found the answer…

    Original:

    <tr class="StatsRow">
         <td class="description">Total Sales</td>
         <td class="stat">
              <span class="TotalSalesRow">
                   <strong>$59,549.16</strong>
                   <div class="wrapStat">
                        <span class="pastStat">($59,799.66)</span>
                        <img src="https://portal.thesba.com/Images/down_arr.gif" alt="decrease">
                        <span class="decreasedStat">0.42%</span>
                   </div>
              </span>
          </td>
    </tr>
    

    It appears that having a span wrap a div causes undesirable action in webkit when you try to change the layout on the containing div.

    Change: (div tag below 2nd td)

    <tr class="StatsRow">
         <td class="description">Total Sales</td>
         <td class="stat">
              <div class="TotalSalesRow">
                   <strong>$59,549.16</strong>
                   <div class="wrapStat">
                        <span class="pastStat">($59,799.66)</span>
                        <img src="https://portal.thesba.com/Images/down_arr.gif" alt="decrease">
                        <span class="decreasedStat">0.42%</span>
                   </div>
              </div>
          </td>
    </tr>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I am trying to understand how to use SyndicationItem to display feed which is
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.