sax0936
高級會員
積分 6292
發文 304
註冊 2005-9-6
狀態 離線
|
#1 〔教學〕可將圖片用滑鼠滾輪放大縮小的語法
可將圖片用滑鼠滾輪放大縮小的語法==================================================================
<HTML>
<HEAD>
<SCRIPT>
var count = 10;
function Picture(){
count = Counting(count);
Resize(count);
return false;
}
function Counting(count){
if (event.wheelDelta >= 120)
count++;
else
if (event.wheelDelta <= -120) count--;
if (count > 0) { return count; }
else { return false; }
}
function Resize(count){
if (count > 0) {
oCount.value = count + '0%';
oImage.style.zoom = count + '0%';
}
else { oImage.style.zoom = '10%'; }
}
</SCRIPT>
</HEAD>
<BODY>
Size: <input type="text" value="100%" id="oCount" readonly><p>
<img id="oImage" src="http://msdn.microsoft.com/workshop/graphics/sprinter.jpg" onmousewheel="Picture()" width="283" height="212" ></p>
</BODY>
</HTML>
=================================================================
QUOTE:
板主曰 : ` 謝謝您的分享! '
[ Last edited by TCG on 2005-9-16 at 12:43 PM ]
|
|