|
 |
|
รบกวนเกี่ยวกับสคริป สุ่มรูปภาพพร้อมลิงค์ติดกับรูป ครับ |
|
 |
|
|
 |
 |
|
จะเลิกงานพอดี คงสร้าง Link ไม่ทันแต่ก็คงไม่ยากนะครับ
ก่อนอื่นท่านไปสร้าง Folder ชื่อ images เพื่อเก็บภาพนะครับจากนั้นสร้างไฟล์นี้เพื่อโชว์ภาพที่จะให้ Random
ImageRandom.html
Code
<html>
<head><title>การแสดงรูปภาพแบบ Random</title>
<script language="JavaScript">
var imageList = ["images/pic1.gif" ,"images/pic2.gif" ,"images/pic3.gif" ,"images/pic4.gif" ,"images/pic5.gif" ,"images/pic6.gif" ,"images/pic7.gif" ,"images/pic8.gif" ,"images/pic9.gif" , "images/pic10.gif" ];
function ShowImage() {
var currentImage = new Image();
var imageChoice = Math.floor(Math.random() * imageList.length);
currentImage.src =imageList[imageChoice];
document["RandomImage"].src = currentImage.src;
document.all.fileName.innerText = imageList[imageChoice].slice(7);
}
function StartShow() {
setInterval("ShowImage()", 2000);
}
</script>
</head>
<body onLoad="StartShow() ">
<center><img name="RandomImage" src="images/pic1.gif" width="200" height="200" >
<div id="fileName">pic1.gif</div></center>
</body>
</html>
ส่วน Link ท่านเสริมต่อเลยนะครับ...
|
 |
 |
 |
 |
Date :
2009-05-04 17:29:58 |
By :
panyapol |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ทำลิงค์ ต่อไม่เป็นหล่ะครับท่าน ><"
รบกวนท่านช่วยทีครับ อิอิ
|
 |
 |
 |
 |
Date :
2009-05-04 17:41:24 |
By :
wynne |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|