欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

在圖片上顯示左右箭頭類似翻頁的代碼

 更新時間:2013年03月04日 14:58:06   作者:  
使用JS實現(xiàn)在圖片上顯示左右箭頭的翻頁代碼.實例使用了javascript的onmousemove 事件,onmousemove 事件會在鼠標指針移動時發(fā)生,感興趣的你可以參考下本文或許對你有所幫助
使用JS實現(xiàn)在圖片上顯示左右箭頭的翻頁代碼,預(yù)覽效果網(wǎng)址:http://www.keleyi.com/keleyi/phtml/picnext/
本實例使用了javascript的onmousemove 事件。onmousemove 事件會在鼠標指針移動時發(fā)生。

語法
onmousemove="SomeJavaScriptCode"
SomeJavaScriptCode是必需參數(shù)。規(guī)定該事件發(fā)生時執(zhí)行的 JavaScript。

下面是核心代碼(完整代碼請在效果頁面查看源代碼):
復(fù)制代碼 代碼如下:

<script type="text/javascript">
function KeleyiImgNext(bigimg) {
var lefturl = "01.html";
var righturl ="03.html";
var imgurl = righturl;
var width = bigimg.width;
var height = bigimg.height;
bigimg.onmousedown = bigimg.onmousemove = function () {
if (event.offsetX < width / 2) {
imgurl = lefturl;
if (imgurl != "#")
bigimg.style.cursor = 'url(images/arr_left.cur),auto';
else
bigimg.style.cursor = 'default';
} else {
imgurl = righturl;
if (imgurl != '#')
bigimg.style.cursor = 'url(images/arr_right.cur),auto';
else
bigimg.style.cursor = 'default';
}
}
bigimg.onmouseup = function () {
if (imgurl != '#')
top.location = imgurl;
}
}
</script>
<img onmouseover="KeleyiImgNext(this)" src="http://www.keleyi.com/keleyi/phtml/picnext/images/k02.jpg" alt="keleyi" />

相關(guān)文章

最新評論