jQuery/CSS 图像问题。 Opera 仅加载部分图像,原因不明

发布于 2024-09-25 10:32:39 字数 1626 浏览 0 评论 0原文

您在使用 Internet Explorer 时遇到日常问题并不奇怪,但当您实际使用像 Opera 这样的浏览器时,您会感到有点惊讶。

我在 Firefox、Chrome 和 IE 上完成了大部分工作(除了 fancybox 没有将所有 IE 修复验证为绿色这一事实之外,但这是另一个问题)。

无论如何,我似乎无法弄清楚的问题最好用屏幕截图来描述!

http://patrikarvidsson.com/stuff/operaissue.jpg

悬停似乎有效,点亮了图像就像它应该做的那样。但它似乎没有像在其他浏览器中那样正确显示“淡出”图像。如上所示,仅显示了部分图像。

Opera 用户可以在 hxxp://www.patrikarvidsson.com/project/portfolio 上查看该网页,

我从今天开始安装了最新的 Opera,为自己重新创建了这个,正如一位朋友报告的那样天前。

// LiveQuery for Fade-Effect

$(".thumb").livequery(function(){ 
$(".thumb").css("opacity","0.6");
    $(".thumb").hover(function () {
        $(this).stop().animate({
           opacity: 1.0
        }, "fast");
},
 function () {
    $(this).stop().animate({
        opacity: 0.6
        }, "fast");
    });
});

其中一个链接的 jQuery .load 代码;

    $("a.dartLink").click(function(){
    $('div#content').load("content/digitalart.php");
    return false;
});

画廊页面之一的链接(由列表包围);

    <a href="index.php?l=digitalart" class="dartLink gallery"><span>Digital Illustrations</span></a>

其中一个拇指的 HTML;

<div class="thumbbox">
<a rel="digitalart" href="thumblink.jpg" class="thumb" title="Astralis"><img src="images/thumbs/AstralisSmall.jpg" alt="" /></a></div>

但转念一想,这可能与 jQuery 无关。我添加了 CSS 标签以防万一。虽然我仍然不知道是什么原因造成的。不幸的是,自从我编辑这篇文章以来,图像和超链接限制再次适用,因为我是新用户。

编辑了帖子。我想我现在已经成功包含了所需的代码。

Not that it's a surprise you encounter daily problems with Internet Explorer, but when you actually do it with a browser like Opera - it kind of throws you off the chair.

I got most things working with Firefox, Chrome and IE (apart from the fact that fancybox isn't validating all the IE-fixes as green, but that's an issue for another time).

Anyway, the problem which I can't seem to figure out is best described with a screenshot!

http://patrikarvidsson.com/stuff/operaissue.jpg

Hover seems to work, lights up the images just as it is supposed to do. But it doesn't seem to correctly show the "faded out" images as it does in the rest of the browsers. As seen above only parts of the images are shown.

Opera-users can see the webpage at hxxp://www.patrikarvidsson.com/project/portfolio

I installed the latest Opera as of today to recreate this for myself, as it was reported by a friend a day ago.

// LiveQuery for Fade-Effect

$(".thumb").livequery(function(){ 
$(".thumb").css("opacity","0.6");
    $(".thumb").hover(function () {
        $(this).stop().animate({
           opacity: 1.0
        }, "fast");
},
 function () {
    $(this).stop().animate({
        opacity: 0.6
        }, "fast");
    });
});

The jQuery .load-code for one of the links;

    $("a.dartLink").click(function(){
    $('div#content').load("content/digitalart.php");
    return false;
});

The link to one of the gallery pages (surrounded by a list);

    <a href="index.php?l=digitalart" class="dartLink gallery"><span>Digital Illustrations</span></a>

The HTML for one of the thumbs;

<div class="thumbbox">
<a rel="digitalart" href="thumblink.jpg" class="thumb" title="Astralis"><img src="images/thumbs/AstralisSmall.jpg" alt="" /></a></div>

On second thought, however, this may not be related to jQuery. I added the CSS tag just in case. Although I still have no idea what is causing this. Unfortunately, since I edited this post, the image and hyperlink limit again applies as I am a new user.

Edited the post. I think I managed to include the needed code now.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

开始看清了 2024-10-02 10:32:39

Patrik,

这不是你问题的核心(在你提供一些我们可以分析的代码之前我不会回答这个问题),但是在使用 IE 时要小心灯箱插件。当页面上有很多图像时,它的行为非常奇怪(即[没有双关语]它会停止整个浏览器的执行,甚至减慢操作系统的速度,直到加载所有图像)。我解决这个问题的方法是使用 colorbox 插件,您可以在这里找到它:

http://colorpowered.com/colorbox/

我发现它和 lightbox 一样灵活,只不过它在 IE 中运行得很好。

Patrik,

This isn't the core of your question (and I will abstain from responding to that until you put up some code that we can analyze), but be careful with the lightbox plugin when using IE. It acts very weirdly when you have a lot of images on the page (i.e. [no pun intended] it will halt the execution of the entire browser and even slow down the operating system until all images are loaded). My solution to this problem was to use the colorbox plugin, which you can find here:

http://colorpowered.com/colorbox/

I find it to be just as snappy as lightbox, except it works perfectly in IE.

场罚期间 2024-10-02 10:32:39

我没有安装 Opera,我非常确信您的问题是因为您正在使用包含缩略图的框的 display:inline
尝试:

.thumbbox {
display: inline-block;
padding: 0px;
}

Opera 只是将图像裁剪为容器的大小(我使用 chrome 开发工具来验证)。您需要将 IE6 和 IE6 的显示设置为内联。 7 并应用 min-height:1%zoom:1 hack 以获得相同的效果。或者,您可以浮动这些 div,这将需要额外的安全保护以确保它们正确包含。

希望有帮助!

编辑

另外,

可能需要设置为 display:block 因为它们都是内联元素。

I don't have opera installed hover I am quite confident that your issue is because you are using display:inline of the boxes containing thumbnails.
Try:

.thumbbox {
display: inline-block;
padding: 0px;
}

Opera is simply cropping the image to the size of the container (I used chrome dev tools to verify). You will need to set the display to inline for IE6 & 7 and apply min-height:1% or zoom:1 hack to get the same effect. Alternatively you can float these divs which will require additional safe guard to ensure they are contained correctly.

Hope that helps!

EDIT

Additionally the <a /> and <span /> tags beneath the <div class="thumbbox" /> may need to be set to display:block as they are both inline elements.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文