:: JustUsers.net ::

:: คนทำเว็บ :: => Simple Machines Forum [SMF] => Portal & Bridge => ข้อความที่เริ่มโดย: phoenix ที่ 13, กรกฎาคม 2011, 08:30:41 AM

หัวข้อ: สำหรับทำภาพสไลด์ ที่หน้า พอทัลครับ เครดิต หมูน้อยครับ
เริ่มหัวข้อโดย: phoenix ที่ 13, กรกฎาคม 2011, 08:30:41 AM
สำหรับทำภาพสไลด์ ที่หน้า พอทัลครับ เครดิต หมูน้อยครับ

เปลี่ยนเฉพาะที่อยู่ของรูปนะครับ

(http://img196.imageshack.us/img196/7032/00000xm.jpg)


โค๊ด: [Select]
<center><table>
  <t>
    <td><!-- saved from url=(0022)http://internet.e-mail -->
<script language="JavaScript">
<!--

/* Here you make an array with all the URL's of the images you would like to have in your slideshow.*/

var image1 = new Array[color=crimson][font=Verdana]("http://www.moto2hand.net/smfm/banner/Pretty/553000012070411.jpg",
"http://www.moto2hand.net/smfm/banner/Pretty/553000012070413.jpg",
"http://www.moto2hand.net/smfm/banner/Pretty/553000012070418.jpg",
"http://www.moto2hand.net/smfm/banner/Pretty/553000012070419.jpg",
"http://www.moto2hand.net/smfm/banner/Pretty/553000017096303.jpg",
"http://www.moto2hand.net/smfm/banner/Pretty/553000017887814.jpg",
"http://www.moto2hand.net/smfm/banner/Pretty/553000017887818.jpg",
"http://www.moto2hand.net/smfm/banner/Pretty/553000017887819.jpg")[/font][/color]
var imgNumber1=1

/* This number is used to refer to a value of the Array and to know what image should be shown next. */


var numberOfImg1 = image1.length

/* This is the total amount of images you use, it is used to determine if the imgNumber can still grow. */


/* Now it's time to make the functions for the next and previous buttons */

function previousImage1(){
  if(imgNumber1 > 1){
imgNumber1--
    }

/* The if statement is used to know if you aren't already at the first image, because if you are, imgNumber may not decrease. */
 
  else{
  imgNumber1 = numberOfImg1
}

/* If you already are at the first image, and you click the previous button, the slideshow must show the last image. */

  document.slideImage1.src = image1[imgNumber1-1]
  
/* Load the image into the document. Don't forget to write imgNumber-1, an array always starts from 0! */
  }

function nextImage1(){
  if(imgNumber1 < numberOfImg1){
imgNumber1++
    }

/* The if statement is used to know if you aren't already at the last image, because if you are, imgNumber may not increase. */

  else{
   imgNumber1 = 1
}

/* If you already are at the last image, and you click the next button, the slideshow must show the first image. */

  document.slideImage1.src = image1[imgNumber1-1]
  
/* Load the image into the document. Don't forget to write imgNumber-1, an array always starts from 0! */
  }
  
  
/* Now it is time for the code that preloads the images. */

/* Check if your browser supports the Image Object. */


   var ret = setInterval('nextImage1()',2000);
//-->
</script>
<img src="http://www.proglogic.com/learn/javascript/BSD.jpg" name="slideImage1"><br />
<a href="JavaScript:previousImage1()">Previous</a>|<a href="JavaScript:nextImage1()">Next</a>

</td>
    <td><!-- saved from url=(0022)http://internet.e-mail -->

<script language="JavaScript">
<!--

/* Here you make an array with all the URL's of the images you would like to have in your slideshow.*/

var image2 = new Array[color=firebrick]("http://www.moto2hand.net/smfm/banner/Car/1.jpg",
"http://www.moto2hand.net/smfm/banner/Car/2.jpg",
"http://www.moto2hand.net/smfm/banner/Car/3.jpg",
"http://www.moto2hand.net/smfm/banner/Car/4.jpg",
"http://www.moto2hand.net/smfm/banner/Car/8.jpg",
"http://www.moto2hand.net/smfm/banner/Car/post-1018-1280422475.jpg",
"http://www.moto2hand.net/smfm/banner/Car/proton-jebat-concept-01_728.jpg",
"http://www.moto2hand.net/smfm/banner/Car/proton-jebat-concept-04_728.jpg")[/color]var imgNumber2=1

/* This number is used to refer to a value of the Array and to know what image should be shown next. */


var numberOfImg2 = image2.length

/* This is the total amount of images you use, it is used to determine if the imgNumber can still grow. */


/* Now it's time to make the functions for the next and previous buttons */

function previousImage2(){
  if(imgNumber2 > 1){
imgNumber2--
    }

/* The if statement is used to know if you aren't already at the first image, because if you are, imgNumber may not decrease. */
 
  else{
  imgNumber2 = numberOfImg2
}

/* If you already are at the first image, and you click the previous button, the slideshow must show the last image. */

  document.slideImage2.src = image2[imgNumber2-1]
  
/* Load the image into the document. Don't forget to write imgNumber-1, an array always starts from 0! */
  }

function nextImage2(){
  if(imgNumber2 < numberOfImg2){
imgNumber2++
    }

/* The if statement is used to know if you aren't already at the last image, because if you are, imgNumber may not increase. */

  else{
   imgNumber2 = 1
}

/* If you already are at the last image, and you click the next button, the slideshow must show the first image. */

  document.slideImage2.src = image2[imgNumber2-1]
  
/* Load the image into the document. Don't forget to write imgNumber-1, an array always starts from 0! */
  }
  
  
/* Now it is time for the code that preloads the images. */

/* Check if your browser supports the Image Object. */


   var ret = setInterval('nextImage2()',2000);
//-->
</script>

<img src="http://www.proglogic.com/learn/javascript/BSD.jpg" name="slideImage2"><br />
<a href="JavaScript:previousImage2()">Previous</a>|<a href="JavaScript:nextImage2()">Next</a>

    </td>
  </tr>
</table>
</center>
หัวข้อ: Re: สำหรับทำภาพสไลด์ ที่หน้า พอทัลครับ เครดิต หมูน้อยครับ
เริ่มหัวข้อโดย: phoenix ที่ 15, กรกฎาคม 2011, 01:04:24 PM
สำหรับเพิ่มภาพ สไลด์ อีกชุดครับ

โค๊ด: [Select]

/* The if statement is used to know if you aren't already at the last image, because if you are, imgNumber may not increase. */

  else{
  imgNumber3 = 1
}

/* If you already are at the last image, and you click the next button, the slideshow must show the first image. */

  document.slideImage3.src = image3[imgNumber3-1]
 
/* Load the image into the document. Don't forget to write imgNumber-1, an array always starts from 0! */
  }
 
 
/* Now it is time for the code that preloads the images. */

/* Check if your browser supports the Image Object. */


   var ret = setInterval('nextImage3()',2000);
//-->
</script>
<img src="http://www.proglogic.com/learn/javascript/BSD.jpg" name="slideImage3"><br />
<a href="JavaScript:previousImage3()">Previous</a>|<a href="JavaScript:nextImage3()">Next</a>

</td>
    <td><!-- saved from url=(0022)http://internet.e-mail -->

<script language="JavaScript">
<!--

/* Here you make an array with all the URL's of the images you would like to have in your slideshow.*/

var image4 = new Array("http://www.moto2hand.net/smfm/banner/Sponser/Kosana.jpg", "http://www.moto2hand.net/smfm/banner/Sponser/watch2.jpg",
"http://www.moto2hand.net/smfm/banner/Sponser/Kosana4.jpg",
"http://www.moto2hand.net/smfm/banner/Sponser/mittare.jpg",
"http://www.moto2hand.net/smfm/banner/Sponser/Kosana3.jpg",
"http://www.moto2hand.net/smfm/banner/Sponser/minorport.jpg",
"http://www.moto2hand.net/smfm/banner/Sponser/Kosana2.jpg",
"http://www.moto2hand.net/smfm/banner/Sponser/minor1.jpg",
"http://www.moto2hand.net/smfm/banner/Sponser/Kosana1.jpg",
"http://www.moto2hand.net/smfm/banner/Sponser/chang.jpg")
var imgNumber4=1

/* This number is used to refer to a value of the Array and to know what image should be shown next. */


var numberOfImg4 = image4.length

/* This is the total amount of images you use, it is used to determine if the imgNumber can still grow. */


/* Now it's time to make the functions for the next and previous buttons */

function previousImage4(){
  if(imgNumber4 > 1){
imgNumber4--
    }

/* The if statement is used to know if you aren't already at the first image, because if you are, imgNumber may not decrease. */
 
  else{
  imgNumber4 = numberOfImg4
}

/* If you already are at the first image, and you click the previous button, the slideshow must show the last image. */

  document.slideImage4.src = image4[imgNumber4-1]
 
/* Load the image into the document. Don't forget to write imgNumber-1, an array always starts from 0! */
  }

function nextImage4(){
  if(imgNumber4 < numberOfImg4){
imgNumber4++
    }

/* The if statement is used to know if you aren't already at the last image, because if you are, imgNumber may not increase. */

  else{
  imgNumber4 = 1
}

/* If you already are at the last image, and you click the next button, the slideshow must show the first image. */

  document.slideImage4.src = image4[imgNumber4-1]
 
/* Load the image into the document. Don't forget to write imgNumber-1, an array always starts from 0! */
  }
 
 
/* Now it is time for the code that preloads the images. */

/* Check if your browser supports the Image Object. */


   var ret = setInterval('nextImage4()',2000);
//-->
</script>

<img src="http://www.proglogic.com/learn/javascript/BSD.jpg" name="slideImage4"><br />
<a href="JavaScript:previousImage4()">Previous</a>|<a href="JavaScript:nextImage4()">Next</a>

    </td>
  </tr>
</table>
</center>
หัวข้อ: Re: สำหรับทำภาพสไลด์ ที่หน้า พอทัลครับ เครดิต หมูน้อยครับ
เริ่มหัวข้อโดย: music125500 ที่ 14, มีนาคม 2013, 06:38:49 AM
ขอบคุณครับผม