0

This only happens on my iPhone. Each time I hide/show an element it gives a different font size. It's only happening when I show and hide more that one element on the "Show All" area

<style>
.asdf_2{
font-size:12px;
}
</style>
<script>
function showhide(x){
    if(document.getElementById(x).style.display == '')
    {
        document.getElementById(x).style.display = 'none';
    }
    else 
    {
        document.getElementById(x).style.display = '';
    }
}
</script>
<div class="content">
    <div class="asdf_all" onClick="showhide('showme1');showhide('showme2');">Show All</div>
    <div class="asdf">
        <div class="asdf_1" onClick="showhide('showme1');">Show1</div>
        <div class="asdf_2" id="showme1" style="display:none">asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
        </div>
    </div>
    <div class="asdf">
        <div class="asdf_1" onClick="showhide('showme2');">Show2</div>
        <div class="asdf_2" id="showme2" style="display:none">asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
        </div>
    </div>
</div>
Ry-
  • 218,210
  • 55
  • 464
  • 476
  • 2
    How do you know that the font size on something you can't see is changing? – Ry- Jan 04 '13 at 21:54
  • The Show1, Show2 displays the font size fine. It's only the "Show All" that is changing the font size. – user1949899 Jan 04 '13 at 21:56
  • Is it fitting the boxes to the screen? Like when you hide the first box there is more room the the second so it expands? – Nick Bray Jan 04 '13 at 21:57
  • yes, there is plenty of room for the content. this is the only code for my experiment. There are not additional styles. – user1949899 Jan 04 '13 at 21:59

1 Answers1

1

"This only happens on my iPhone."

See this:

How to avoid iOS automatic font size adjustment?

body {
    -webkit-text-size-adjust: 100%;
}
Community
  • 1
  • 1
Sparky
  • 98,165
  • 25
  • 199
  • 285