如何将其他图像上传到html5& javascript幻灯片

时间:2015-12-02 19:14:39

标签: javascript css html5

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Slideshow</title>
<link rel="stylesheet" type="text/css" href="slideshow.css">

<script type="text/javascript">
var imagecount = 1;
var total = 6;

function slide(x) {
var Image = document.getElementById('img');
imagecount = imagecount + x;
if(imagecount > total){ imagecount = 1;}
if(imagecount < 1){ imagecount = total;}
Image.src = "Images/img"+ imagecount +".jpg";
}

</script>
</head>

//div id sections are also formatted through css
<body>
<div id="container">\
<img src="Images/img1.jpg" id="img"/>
<div id="left_holder"> <img onClick="slide(x-1)" class="left"         src="arrowleft.jpg"/></div>
<div id="right_holder"> <img onClick="slide(1)" class="right"      src="arrowright.jpg"/></div>
</div>

</body>
</html>

有没有什么方法可以添加'addLoadEventToFileSelect'&amp;这是正确的方法吗

0 个答案:

没有答案