a problem of jQuery's fadeIn() in iPhone (Version>=1.8.0)
I found a special bug of fadeIn. It blinks twice in iphone browser,and In PC browser is ok.
This bug appear in the version 1.8.0 and higher. In 1.7.2 is ok.
The link:
Use Iphone's safari, and press the browser Back and Forward buttons after clicked the button.
The code:
- <!DOCTYPE html>
- <html>
- <head>
- <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
- <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
- </head>
- <body>
- <div style="position:fixed;top:0;left:0;right:0;bottom:0;">
- <div id="aaaaaa" style="position:absolute;">
- aaaaaaaaaaaaa<br />
- aaaaaaaaaaaaa<br />
- aaaaaaaaaaaaa<br />
- </div>
- </div>
- <script type="text/javascript">
- window.onhashchange = function()
- {
- setTimeout(function(){
- var obja = $('#aaaaaa');
- if (obja.css('display')=='none')
- {
- obja.fadeIn();
- }
- else
- {
- obja.fadeOut();
- }
- },100);
- };
- </script>
- <div style="position:absolute;top:150px;z-index:10;">
- <input type="button" value="click" onclick="document.location.hash='test'" />
- Use Iphone's safari, and press the browser Back and Forward buttons after clicked the button.
- </div>
- </body>
- </html>