dsg41888 2013-09-04 15:26
浏览 59

使用jQuery和PHP预加载PDF以与Chrome配合使用

I have a page where a PDF is embedded and I'm using a preloader. In Firefox works perfectly, but in Chrome or Safari doesn't. The preload text and image stays only for a second, after that a grey screen appears and stays till the file is loaded.

Here is my code:

<body>
    <div id="loading">
        <div class="pretxt">Please be patient, you won't regret!</div>
        <div class="preimg">
            <img src="path/to/image/loader.gif" width="126" height="22" alt="Loading..." />
        </div>
    </div>
    <embed src="/path/to/file/pdf.pdf" width="100%" height="100%" alt="pdf" id="pdf" pluginspage="http://www.adobe.com/products/acrobat/readstep2.html">
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
    $(window).load(function()
        {
        $("#loading").fadeOut("slow");
    });
    </script>
    </body>

Can you please give some advices? Thank you!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 关于smbclient 库的使用
    • ¥15 微信小程序协议怎么写
    • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
    • ¥20 怎么用dlib库的算法识别小麦病虫害
    • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
    • ¥15 java写代码遇到问题,求帮助
    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画