masooodj67
چهارشنبه 28 فروردین 1392, 16:15 عصر
سلام دوستان در صفحم میخام اسلاید بگذارم ولی وقتی این کار رو میکنم جواب نمیگیرم اینم کدش
<html>
<head>
<style type="text/css">
.auto-style1 {
width: 100%;
}
</style>
<script type="text/javascript">
var width = 100%;
var height = 500;
var imgAr1 = new Array();
var rImg1 = new Array();
imgAr1[0] = "008.jpg";
imgAr1[1] = "kia-optima.jpg";
imgAr1[2] = "url.jpg";
imgAr1[3] = "saman.jpg";
for(var j = 0; j < imgAr1.length; j++)
{
rImg1[j] = new Image();
rImg1[j].src = imgAr1[j];
}
document.onload = setting();
var slide;
function setting()
{
slide = document.getElementById('pic');
slide.src = imgAr1[0];
slide.setAttribute("width",width);
slide.setAttribute("height",height);
}
//Image or picture slide show using java script
//slideshow function
var picture = 0;
function Next(){
if(picture < imgAr1.length-1){
picture=picture+1;
slide.src = imgAr1[picture];
}
}
function prev(){
if(picture > 0 ){
picture=picture-1;
slide.src = imgAr1[picture];
}
}
function start(){
slide.src = imgAr1[0];
picture = 0;
}
function end(){
slide.src = imgAr1[imgAr1.length-1];
picture = imgAr1.length-1
}
</script>
</head>
<body>
<table class="auto-style1">
<tr>
<td style="height: 500px" valign="top"><img id="pic" alt="" src="008.jpg" /></td>
</tr>
<tr>
<td>
<table class="auto-style1">
<tr>
<td style="text-align: center"><a style="color: blue; cursor: pointer;" href="#" onclick="start()">Start</a></td>
<td style="text-align: center"><a style="color: blue; cursor: pointer;" href="#" onclick="Next()">Next</a></td>
<td style="text-align: center"><a style="color: blue; cursor: pointer;" href="#" onclick="prev()">Prev</a></td>
<td style="text-align: center"><a style="color: blue; cursor: pointer;" href="#" onclick="end()">End</a></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<html>
<head>
<style type="text/css">
.auto-style1 {
width: 100%;
}
</style>
<script type="text/javascript">
var width = 100%;
var height = 500;
var imgAr1 = new Array();
var rImg1 = new Array();
imgAr1[0] = "008.jpg";
imgAr1[1] = "kia-optima.jpg";
imgAr1[2] = "url.jpg";
imgAr1[3] = "saman.jpg";
for(var j = 0; j < imgAr1.length; j++)
{
rImg1[j] = new Image();
rImg1[j].src = imgAr1[j];
}
document.onload = setting();
var slide;
function setting()
{
slide = document.getElementById('pic');
slide.src = imgAr1[0];
slide.setAttribute("width",width);
slide.setAttribute("height",height);
}
//Image or picture slide show using java script
//slideshow function
var picture = 0;
function Next(){
if(picture < imgAr1.length-1){
picture=picture+1;
slide.src = imgAr1[picture];
}
}
function prev(){
if(picture > 0 ){
picture=picture-1;
slide.src = imgAr1[picture];
}
}
function start(){
slide.src = imgAr1[0];
picture = 0;
}
function end(){
slide.src = imgAr1[imgAr1.length-1];
picture = imgAr1.length-1
}
</script>
</head>
<body>
<table class="auto-style1">
<tr>
<td style="height: 500px" valign="top"><img id="pic" alt="" src="008.jpg" /></td>
</tr>
<tr>
<td>
<table class="auto-style1">
<tr>
<td style="text-align: center"><a style="color: blue; cursor: pointer;" href="#" onclick="start()">Start</a></td>
<td style="text-align: center"><a style="color: blue; cursor: pointer;" href="#" onclick="Next()">Next</a></td>
<td style="text-align: center"><a style="color: blue; cursor: pointer;" href="#" onclick="prev()">Prev</a></td>
<td style="text-align: center"><a style="color: blue; cursor: pointer;" href="#" onclick="end()">End</a></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>