页面图片,带箭头左右翻页和滚轮缩放的效果js代码

发布网友 发布时间:2022-04-22 06:00

我来回答

1个回答

热心网友 时间:2023-07-02 16:42

<script>

var picarr=new Array("1.jpg","2.jpg","3.jpg");

var mypoint=-1;

function changepic(myflag)

{

if(myflag<0)

{

mypoint=mypoint-1;

if (mypoint<0) { mypoint=picarr.length-1;}

}

else

{

mypoint=mypoint+1;

if (mypoint==picarr.length) { mypoint=0;}

}

document.getElementById("pic").src=picarr[mypoint];

}

</script>

<body style="text-align:center;" onload="changepic(0);">

<div style="width:810px;background-color:#eee">

<span onclick="changepic(-1);" onmousemove="this.style.color='red';" onmouseout="this.style.color='blue';" style="cursor: hand">《-LastOne </span>

<img id=pic border="0" width=600 style="text-align:center;vertical-align:middle;"/>

<span onclick="changepic(0);" style="cursor: hand;" onmousemove="this.style.color='red';" onmouseout="this.style.color='blue';" > NextOne-》</span>

</div>

<body>

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com