View Full Version : image gallery - code failed

07-26-2008, 04:49 AM
Hi all. So I'm trying to make a simple image gallery on a website with css + javascript, and I got the code somewhere. I have a list of images, and I just want to press next to view the next one, pretty straight forward. Can you guys go to kailihsu.com > works, and click on anyone of the projects and check the code for me please? It's not working right now... Thanks!

07-26-2008, 05:10 AM
Im not sure but document.all isnt widely supported.

07-26-2008, 08:20 AM
I don't quite get it, but can you suggest how could I fix it? Thanks.

07-26-2008, 02:45 PM
Im sure you can id the area thats causing the problem and post your code. If your after a script request then post it in the site script request section. I said it was a hunch about document.all as this Im sure is IE only (it may be that its everything but IE but I know that its not supported accross all, can someone confirm?)

Posting "click on anyone of the projects and check the code for me please" and "I don't quite get it, but can you suggest how could I fix it" isnt going to get anyone to help you!

If you wrote the code then you would have an understanding of why it doesnt work or at least know where it fails which would in turn be more of a viable question. Since Im the only one who has taken the time to answer you it doesnt mean Im going to do everything for you. Ill help as much as I can because I know how much problems can be annoying and how help is appreicated but that being said, dont ask me to just fix it.

Kind regards

07-26-2008, 03:36 PM
wow... what a lesson...
thanks I guess..

07-26-2008, 05:06 PM
Use these styles:

.slides {
left: 300px;
top: 141px;
visibility: hidden;
#image1 {
visibility: visible;

This script:

<script type="text/javascript">
var numSlides = 32;
var currentSlide = 1;

function switchSlide(sDir) {
newSlide = currentSlide + sDir;
if (!newSlide) newSlide=numSlides;
if (newSlide > numSlides) newSlide=1;
document.getElementById('image' + newSlide).style.visibility="visible";
document.getElementById('image' + currentSlide).style.visibility="hidden";
currentSlide = newSlide;


Get rid of the body onload event:

<BODY onLoad="setUp()">

07-27-2008, 12:43 AM
Thanks!! It works!