jQuery HiSRC插件总是加载视网膜图像

时间:2013-12-08 08:19:34

标签: jquery css responsive-design retina-display

我正在使用HiSRC jQuery插件为视网膜显示器加载更大的图像。作为测试,我将较大的图像设置为鲜红色,以便我可以确定它们何时加载以及何时不加载。

然而,似乎视网膜图像一直在加载,即使在我的2009款iMac上使用FF也是如此。

我还可以在Firebug中看到我的页面HTML中的'src'属性被插件修改,以便默认图像与视网膜交换:

Firebug

我用来调用脚本的所有内容如下: $(".hisrc img").hisrc();

然而,在我的文本编辑器中,我将其编码为:

<figure class="hisrc">
    <a href="<?php bloginfo('url'); ?>/"><img src="<?php bloginfo('template_url'); ?>/image/logo.png" data-1x="<?php bloginfo('template_url'); ?>/image/logo-1x.png" alt="Logo" /></a>
</figure>

以下是该网站的链接: http://bit.ly/ITLq8L

谁能看到我做错了什么?

1 个答案:

答案 0 :(得分:0)

您需要为视网膜图像源添加“data-2x”属性。

“data-1x”属性用标准分辨率图像替换(低分辨率)默认图像。

来源:HISRC documentation

相关问题