我想使用 hisrc 方法根据用户的带宽显示响应图像。我也在我的 iphone 4s 上测试了我的桌面上的文件,它仍然只显示默认的较小的 src 图像而不是较大的图像。你能在我的代码中看到任何可能是它不起作用的原因吗?谢谢
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN"
"http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml"/>
<meta name="HandheldFriendly" content="True" />
<title>Gifts</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<link rel="stylesheet" href="xhtml2gradientjava1.css" type="text/css" charset="utf-8"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="hisrc.js"></script>
<script type="text/javascript">
$.hisrc.speedTest();
$(document).ready(function(){
$(".products").hisrc();
}
</script>
</head>
<body>
<div id="content">
<img class="products centre" src="images/bracelet_opt.jpg" data-1x="images/br0266_300x300.jpg" data-2x="images/br0266_300x300.jpg" />
<div class="box_desc"><h3>Silver Beaded Heart Bracelet</h3><p>Ref: #BD0266</p>
<div class="description">
<h4>Description</h4>
<p>Beaded Heart Bracelet by Newbridge Silverware. Silver plated heart detail bracelet with a protective anti tarnish layer, presented in a Newbridge Silverware gift box.</p> <h5>Dimensions:</h5> <p>240mm in length and 5mm in width.</p>
</div>
</div>
</div>
</body>
</html>
另外我想知道我是否需要同时包含 data-1x 和 data-2x,因为某些图像 300x300 是我拥有的最大图像。该网站将针对手机,而不是平板电脑或 iPad。谢谢