HTML DOM Image lowsrc 屬性
定義和用法
lowsrc 屬性可設置或返回圖像的低分辨率版本的URL。
語法
imageObject.lowsrc=URL
瀏覽器支持
所有主要瀏覽器都支持lowsrc 屬性
實例
實例
下面的例子可創建一個指向圖像的低分辨率版本的鏈接:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
</head>
<body>
<img id="compman" src="compman.gif" lowsrc="compman_lowres.gif" alt="Computerman" width="107" height="98">
<br>
<script>
var x=document.getElementById("compman");
document.write('<a href="' + x.lowsrc + '">低分辨率</a>');
</script>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
</head>
<body>
<img id="compman" src="compman.gif" lowsrc="compman_lowres.gif" alt="Computerman" width="107" height="98">
<br>
<script>
var x=document.getElementById("compman");
document.write('<a href="' + x.lowsrc + '">低分辨率</a>');
</script>
</body>
</html>
嘗試一下»
Image對象