码迷,mamicode.com
首页 > 其他好文 > 详细

3d旋转展示代码

时间:2014-10-25 20:00:04      阅读:126      评论:0      收藏:0      [点我收藏+]

标签:style   io   ar   java   for   div   on   cti   代码   

<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>3D展示</title>
<style type="test/css">
#box{
height:378px;
width:640px;
}
</style>
</head>

<body onload="init();">
<div id="box">
<img id="img" src="E:/img/miaov (0).jpg">
</div>
<input type="button" value="show" onclick="show();" />
<input type="button" value="stop" onclick="stop();" />
<script type="text/javascript">
var box;
var pic_arr=[];
var index=0;


function init(){
box=document.getElementById("box");
for(var i=0;i<=76;i++){
pic_arr[i]=document.createElement("img");
pic_arr[i].src="E:/img/miaov ("+i+").jpg";
}

}
function picRoll(){
if(index==0){
try{
box.removeChild(pic_arr[76]);
}catch(e){

}
box.appendChild(pic_arr[0]);
index++;
}else if(index>0&&index<=76){
box.removeChild(pic_arr[index-1]);
box.appendChild(pic_arr[index]);
index++;
}else if(index>76){
index=0;
}
}

function show() {
var aa=document.getElementById("img");
box.removeChild(aa);
taskid=setInterval(picRoll,50);
}

function stop(){
clearInterval(taskid);
}

</script>
</body>
</html>

3d旋转展示代码

标签:style   io   ar   java   for   div   on   cti   代码   

原文地址:http://www.cnblogs.com/djm5217/p/4050715.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!