/    Sign up×
Community /Pin to ProfileBookmark

style changes on the iphone when updating text dynamically, scaling issue?

I have a few divs thats I dynamically update by changing the style from none to block

They look fine on the ipad, FireFox, IE, Chrome

But when I check the iphone, the text within these divs seem to not scale correctly. The divs have both a class and a style, eg:

[CODE]
<div style=”display: block;” id=”rot1″ class=”contentcentre”>
<ul class=”news”>
<li><div class=”listart”></div>
<h3>title 1</h3> <p>text1</p>
</li>
</ul>
</div>
<div style=”display: none;” id=”rot1″ class=”contentcentre”>
<ul class=”news”>
<li><div class=”listart”></div>
<h3>title 2</h3> <p>text2</p>
</li>
</ul>
</div>
<div style=”display: none;” id=”rot1″ class=”contentcentre”>
<ul class=”news”>
<li><div class=”listart”></div>
<h3>title 3</h3> <p>text3</p>
</li>
</ul>
</div>

[/CODE]

[For reference, the site is rightsfortenants.co.uk and you can see the text rotating (wait 30 seconds) … but you will only see this on the iphone ]

Does anyone know what the issue it (is it due to the scaling?), and how would I go about fixing this?

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@cbVisionJul 14.2011 — I've found adding this helpful when dealing with mobile scaling:

[CODE]<meta name="viewport" content="width=device-width; initial-scale=1.0">[/CODE]
Copy linkTweet thisAlerts:
@Mr_TuitionauthorJul 14.2011 — Thanks for your fast reply cbVision

I should have mentioned, it looks correct for the first div that is not hidden (and it looks a good size). Its only after hiding the first div and showing the next div that the problem occurs (they use the same styles so should use the same fonts and scale the same)

From what I've read so far, it looks like viewport looks more related to how the entire page should be scaled rather than fonts, but its the Fonts that aren't scaling correctly:

http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html
×

Success!

Help @Mr_Tuition spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...