Notes
A. External JS File
You can choose to place the script in the head of your document or in an external .js file. Make sure that when inserting the head HTML, your source is the name of your .js file.
B. Image Folder
Configure the folder of the images.
C. Configure Image Extension
// Tells Browser Where to Find the Image var myImgSrc = "images/";
This gallery supports only one type of file extension but you can make edits so that it can support multiple file extensions. Configure it to either .gif, .jpg or any other image extensions.
D. Adding Images
// Tells Browser the Type of File var myImgEnd = ".gif";
Go over to...
E. Configure Array Number
var myImg= new Array()Edit and insert as many arrays as you want. Put it only the file name, no folder name or extension, unless you have edited it to support multiple extensions.
myImg[0]= "image_1"; ... ... ... ... ... ... myImg[11]= "image_12"; myImg[12]= "image_13";
// If the Number Variable is More Than [Minus 1 of the Number of Arrays]
if(i>2){
As stated in the previous step, an example, I have 13 image, a total of 12 arrays, so I type in 11.
if(i>11){
To have the next button at the last image jump back to the first image, refer to your next() function.
G. Loop Gallery:First to Last
// Create Next Number Variable which Equals to Number Variable var l = iSimply give var l and i a zero value.
var l = i = 0;
For the previous button at image 1 to jump to the last image, refer to the prev() function.
// Create Another Next Number Variable which Equals to Number Variable var l = iSimply change the value of l and i by adding equal to one less of the number of images.
var l = i = myImg.length-1;
Source
External Javascript File [NPIG.js] . Head . Body
I am very interested to know who uses my scripts, for statistic purposes.
If you have the time, I would really appreciate if you could kindly fill in this form.
Please fill in all the fields so that the data will be saved. Thank you.
If you have the time, I would really appreciate if you could kindly fill in this form.
Please fill in all the fields so that the data will be saved. Thank you.
| Name: | |
| URL: | |
| Rating: | |
Oldest to Newest
Comments
Name: Email: Website: Comment: By submitting your comments, you agree to the terms and conditions.
