Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Slideshow

Parašė AceN· 2010 Geg. 12 17:05:15
#1

Sveiki.Prireikė slideshow panėlės.Internete susiradau tokia :
<html>

<head>

<title>Simple Slideshow</title>

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

// Add your pictures to an array called pics
pics = new Array();

// Set the title and file location (URL) of each pics element
// Add as many pictures as you want
// Note that JavaScript arrays start at 0
pics[0] = new Array("Title 1", "your_file_1_url.jpg");
pics[1] = new Array("Title 2", "your_file_2_url.jpg");
pics[2] = new Array("Title 3", "your_file_3_url.jpg");
pics[3] = new Array("Title 4", "your_file_4_url.jpg");
pics[4] = new Array("Title 5", "your_file_5_url.jpg");

// Set the index of the first image (array starts at 0)
var index = 0;

// Increments the picture
function incrementPic() {
   index = index + 1;

   if (index == pics.length) {
 *index = 0;
   }
   loadPic();

return;
}

// Decrements the picture
function decrementPic() {
   index = index - 1;

   if (index < 0) {
 *index = pics.length - 1;
   }
   loadPic();

return;
}

// Loads the picture onto the page
function loadPic() {
   document.images["pic"].src = pics[index][1];
   document.images["pic"].alt = pics[index][0];

return;
}

// -->
</script>

</head>

<body onload="loadPic();">

<p><img name="pic" src="images/spacer.gif" border="0" alt="" /></p>
<p><a href="javascript:decrementPic();">PREV</a> | <a href="javascript:incrementPic();">NEXT</a></p>

</body>

</html>




Klausimas ar ji geras ir veiks.Ją reik iššsaugot į js failą ar iškart į html tinklapį

Redagavo AceN· 2010 Geg. 12 17:05:33