- This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hi –
I have a simple JS that i am using to show a picture gallery. Simply click on the thumbnail, and the larger version of the image is shown in the designated area. It is working excatly how I wanted it to up till this point.
I have decided that I want to add previous and next arrows, but have not been able to get them to work. The pictures are in an array with the larger versions of the images named; 1.jpg, 2.jpg, 3.jpg, etc… and the thumbnail versions corresponding with t1.jpg, t2.jpg, t3.jpg, etc…
What JS and html do i need to get this working?
Java
// set variables
var count = 0
var portImages = new Array()
// define images in array
var i = 1
while (i <= imgCount) {
portImages = i+".jpg"
i++
}
// preload portfolio images
var preloadedimages=new Array()
for (i=1;i<=imgCount;i++){
preloadedimages=new Image()
preloadedimages.src=portImages
}
// function for viewing previous image
function showImage(whichImage) {
document.getElementById('large_image').src = portImages[whichImage]
}
html
«Prev
Next »
Any help would be appreciated.
Hello,
I have similar idea: I’ve found this:
where “slide’ is a class name of images, and first image has {display: block} , and other have {display:none;} .
Buttons are like this:
It works pretty well, except IE – so I think it has a tiny defect, which I cannot find: I am not a programmer. My gallery is very simple, with thumbs as well.
I will by grateful for any help to make it working in IE.