<tfoot id='E3eec'></tfoot>
      • <bdo id='E3eec'></bdo><ul id='E3eec'></ul>

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

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

      适用于ajax嵌入式图像链接的jquery图像预览?

      时间:2023-09-05

          <bdo id='TgTNr'></bdo><ul id='TgTNr'></ul>
        • <small id='TgTNr'></small><noframes id='TgTNr'>

            <tbody id='TgTNr'></tbody>
          <legend id='TgTNr'><style id='TgTNr'><dir id='TgTNr'><q id='TgTNr'></q></dir></style></legend>
          <i id='TgTNr'><tr id='TgTNr'><dt id='TgTNr'><q id='TgTNr'><span id='TgTNr'><b id='TgTNr'><form id='TgTNr'><ins id='TgTNr'></ins><ul id='TgTNr'></ul><sub id='TgTNr'></sub></form><legend id='TgTNr'></legend><bdo id='TgTNr'><pre id='TgTNr'><center id='TgTNr'></center></pre></bdo></b><th id='TgTNr'></th></span></q></dt></tr></i><div id='TgTNr'><tfoot id='TgTNr'></tfoot><dl id='TgTNr'><fieldset id='TgTNr'></fieldset></dl></div>
          • <tfoot id='TgTNr'></tfoot>
                本文介绍了适用于ajax嵌入式图像链接的jquery图像预览?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                那里有各种优秀的 jquery 图像预览插件.但是,我测试过的所有链接都没有在使用 ajax 嵌入到 DOM 中的图像链接上工作.

                there are various good jquery image preview plugins out there. however, all of the ones i've tested havent worked on image links that are embedded in the DOM with ajax.

                我已经测试过使用 jquery live 功能,但它不能完美地工作.

                i have tested use jquery live feature, but it doesnt work flawless.

                $('a.preview').live('mouseover', function() {
                    $(this).imgPreview({
                        imgCSS: {
                            //width: '200px'
                        },
                        preloadImages:      'true',
                    });
                });
                

                我正在使用这个:http://www.webresourcesdepot.com/jquery-image-preview-plugin-imgpreview/

                问题是我必须像你在上面看到的那样实时使用 jquery.但有两个缺陷.

                the problem is that i have to use jquery live as u see above. but there is 2 flaws.

                1. 如果我第一次将鼠标移到缩略图上时它没有显示预览,我想那是因为我还没有获取图像.所以我必须将鼠标从图像上移开并再次回到图像上,然后才会显示出来.这很烦人.

                1. if i move the mouse over the thumbnail the first time it doesnt show the preview, i guess that is because i hasnt fetched the image yet. so i have to move the mouse away from the image and back over the image again, then it'll be shown. and that is very annoying.

                它不会预加载图像.如果您在他们的网站上查看他们正在使用它,而不是这样:

                it doesnt preload the images. if you check on their website they are using it like this instead:

                $('a.preview').imgPreview({preloadImages: '真',});

                $('a.preview').imgPreview({ preloadImages: 'true', });

                这将在 DOM 完全加载后预加载所有预览.但我已经封装了这个功能.但即使我没有,也不会导致我在加载 DOM 后使用 ajax 添加这些图像链接.

                and that will preload all previews after DOM is fully loaded. but i have encapsulated the function. but even if i didnt, it cant cause i add these image links with ajax AFTER DOM is loaded.

                我想知道是否有人知道一个插件可以对 ajax 加载的元素执行相同的操作,包括预览和预加载.

                i wonder if someone knows about a plugin that could do same stuff on ajax-loaded elements, both preview and preload.

                谢谢.

                推荐答案

                将其添加到鼠标悬停将无济于事,因为重点是在图像被悬停之前预加载图像...(以便它们在鼠标悬停)..

                adding it to the mouseover will not help, as the whole point is to preload the images before they get moused over ... (so that they are available at mouseover)..

                您应该在将新链接(来自 ajax)附加到 dom 之后立即添加 $('a.preview').imgPreview(...) ..

                you should add the $('a.preview').imgPreview(...) right after you attach the new links (from ajax) to the dom ..

                这篇关于适用于ajax嵌入式图像链接的jquery图像预览?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:尽管在静态目录中有它,但无法将 javascript 应用于我在烧瓶中的模板.如何在下面的代码中解决这个问题? 下一篇:如何使用 javascript 更改一个对象中的键?

                相关文章

              1. <tfoot id='1JbR8'></tfoot>
              2. <legend id='1JbR8'><style id='1JbR8'><dir id='1JbR8'><q id='1JbR8'></q></dir></style></legend>

                <small id='1JbR8'></small><noframes id='1JbR8'>

                • <bdo id='1JbR8'></bdo><ul id='1JbR8'></ul>

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