2

I have a multi page template developed in jquery mobile.The problem I am facing is whenever I navigate from one page to another in Firefox(desktop.Version 12),the backgrounds of buttons,listview etc disappear at first,but their labels stay for a while.By that time the content of the second page appears.For a split second,the labels of the previous page is superimposed on the new page.Though it stays for a split second only,it looks weird since there are a number of components in the page.I know page transitions will not work with firefox and I am ok with that.But this rendering issue should not happen.

Code I am using:

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Test</title>
        <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" />
        <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
        <script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>

    </head>

    <body>
        <div data-role="page" id="page1">
            <div data-role="header">
                <h1>Page1</h1>
            </div>
            <button>button</button>
            <button>button</button>
            <button>button</button>
            <button>button</button>
            <button>button</button>
            <div data-role="content">
                <ul data-role="listview" data-inset="true">
                    <li>
                        <a href="#page2">aaa</a>
                    </li>
                    <li>
                        <a href="#page2">aaaaa</a>
                    </li>
                    <li>
                        <a href="#page2">bbbbbbbb</a>
                    </li>
                </ul>
            </div>
        </div>
        <div data-role="page" id="page2">
            <div data-role="header" >
                <h1>Page 2</h1>
                <a href="#page1"  data-back-btn="true"  data-icon="back" class="ui-btn-left">Back</a>
            </div>
            <div data-role="content">
                This content is for page 2..
                <ul data-role="listview" data-inset="true">
                    <li>
                        <a href="#page1">BBBBBBBB</a>
                    </li>
                    <li>
                        <a href="#page1">WWWWWWWWWW</a>
                    </li>
                    <li>
                        <a href="#page1">FFFFFFFFFFFFFFFFFF</a>
                    </li>
                </ul>
            </div>
        </div>
    </body>
</html>

A demo here - http://jsfiddle.net/5FZb7/

Note:

If I use jquery mobile 1.1 version,this issue is not happening.But in my project I have to use the legacy version 1.0.1 since we have already used it for most part of the project and dont want to upgrade to 1.1 at this moment.

Thanks in advance.

4

1 回答 1

2

实际上不知道,为什么它起作用,但指定data-transition修复它。
最有趣的是,即使data-transition="fade"应该默认应用,也修复了它。

   <a href="#page1" data-transition="fade">I am good for FF12</a>
   <a href="#page1">And I am bad</a>
于 2012-06-06T12:11:07.553 回答