<legend id='AkKu8'><style id='AkKu8'><dir id='AkKu8'><q id='AkKu8'></q></dir></style></legend>
    • <bdo id='AkKu8'></bdo><ul id='AkKu8'></ul>
    <i id='AkKu8'><tr id='AkKu8'><dt id='AkKu8'><q id='AkKu8'><span id='AkKu8'><b id='AkKu8'><form id='AkKu8'><ins id='AkKu8'></ins><ul id='AkKu8'></ul><sub id='AkKu8'></sub></form><legend id='AkKu8'></legend><bdo id='AkKu8'><pre id='AkKu8'><center id='AkKu8'></center></pre></bdo></b><th id='AkKu8'></th></span></q></dt></tr></i><div id='AkKu8'><tfoot id='AkKu8'></tfoot><dl id='AkKu8'><fieldset id='AkKu8'></fieldset></dl></div>
  • <small id='AkKu8'></small><noframes id='AkKu8'>

      1. <tfoot id='AkKu8'></tfoot>
      2. 交换 img src 或显示/隐藏多个图像是否更快?

        Is it faster to swap an img src or show/hide multiple images?(交换 img src 或显示/隐藏多个图像是否更快?)

            <tfoot id='d202x'></tfoot>

            <small id='d202x'></small><noframes id='d202x'>

                <bdo id='d202x'></bdo><ul id='d202x'></ul>
              • <i id='d202x'><tr id='d202x'><dt id='d202x'><q id='d202x'><span id='d202x'><b id='d202x'><form id='d202x'><ins id='d202x'></ins><ul id='d202x'></ul><sub id='d202x'></sub></form><legend id='d202x'></legend><bdo id='d202x'><pre id='d202x'><center id='d202x'></center></pre></bdo></b><th id='d202x'></th></span></q></dt></tr></i><div id='d202x'><tfoot id='d202x'></tfoot><dl id='d202x'><fieldset id='d202x'></fieldset></dl></div>

                <legend id='d202x'><style id='d202x'><dir id='d202x'><q id='d202x'></q></dir></style></legend>

                  <tbody id='d202x'></tbody>

                  本文介绍了交换 img src 或显示/隐藏多个图像是否更快?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在网页上交换图片时使用的最佳做法是什么?更改图像源或仅在页面上显示/隐藏多个图像?

                  What is the best practice to use when swapping an image on a webpage? Altering the image source or just showing/hiding multiple images on the page?

                  推荐答案

                  为了平衡速度,你必须选择,有两个选项:

                  you have to choose in order to balance speed, with your two options:

                  修改图片来源

                  这样,页面加载速度会更快,因为它只获取可见图像,但是当您更改 src 属性时,显示新图像会花费更长的时间

                  this way, the page will load faster because it only gets the visible images but it will take a little longer to show the new image when you change src attribute

                  只显示/隐藏多张图片

                  这样,您将在页面加载时加载所有图像,这将使其加载速度变慢而交换图像速度更快

                  this way, you are loading all the images on page load which will make it slower on loading and faster on swapping the images

                  这篇关于交换 img src 或显示/隐藏多个图像是否更快?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Pause youtube video, youtube api(暂停 youtube 视频,youtube api)
                  Youtube iframe api not triggering onYouTubeIframeAPIReady(Youtube iframe api 未触发 onYouTubeIframeAPIReady)
                  How can I stop a video with Javascript in Youtube?(如何在 Youtube 中停止使用 Javascript 的视频?)
                  Embed YouTube video - Refused to display in a frame because it set #39;X-Frame-Options#39; to #39;SAMEORIGIN#39;(嵌入 YouTube 视频 - 拒绝显示在框架中,因为它将“X-Frame-Options设置为“SAMEORIGIN)
                  How to call Greasemonkey#39;s GM_ functions from code that must run in the target page scope?(如何从必须在目标页面范围内运行的代码中调用 Greasemonkey 的 GM_ 函数?)
                  How do you mute an embedded Youtube player?(如何使嵌入式 Youtube 播放器静音?)
                    <i id='QdduP'><tr id='QdduP'><dt id='QdduP'><q id='QdduP'><span id='QdduP'><b id='QdduP'><form id='QdduP'><ins id='QdduP'></ins><ul id='QdduP'></ul><sub id='QdduP'></sub></form><legend id='QdduP'></legend><bdo id='QdduP'><pre id='QdduP'><center id='QdduP'></center></pre></bdo></b><th id='QdduP'></th></span></q></dt></tr></i><div id='QdduP'><tfoot id='QdduP'></tfoot><dl id='QdduP'><fieldset id='QdduP'></fieldset></dl></div>

                      <legend id='QdduP'><style id='QdduP'><dir id='QdduP'><q id='QdduP'></q></dir></style></legend>
                        <tbody id='QdduP'></tbody>
                        <tfoot id='QdduP'></tfoot>
                      1. <small id='QdduP'></small><noframes id='QdduP'>

                          <bdo id='QdduP'></bdo><ul id='QdduP'></ul>