Results 1 to 7 of 7

Thread: image gallery - code failed

  1. #1
    Join Date
    Jul 2008
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default image gallery - code failed

    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!

  2. #2
    Join Date
    Jul 2008
    Posts
    102
    Thanks
    36
    Thanked 6 Times in 6 Posts

    Default

    Im not sure but document.all isnt widely supported.
    Programmers are tools used to convert Caffeine to code

  3. #3
    Join Date
    Jul 2008
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I don't quite get it, but can you suggest how could I fix it? Thanks.

  4. #4
    Join Date
    Jul 2008
    Posts
    102
    Thanks
    36
    Thanked 6 Times in 6 Posts

    Default

    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
    Dal
    Programmers are tools used to convert Caffeine to code

  5. #5
    Join Date
    Jul 2008
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    wow... what a lesson...
    thanks I guess..

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Use these styles:

    Code:
    .slides {
    	position:absolute; 
    	left: 300px; 
    	top: 141px; 
    	visibility: hidden;
    }
    #image1 {
    visibility: visible;
    }
    This script:

    Code:
    <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;
    }
    
    //-->
    </script>
    Get rid of the body onload event:

    Code:
    <BODY onLoad="setUp()">
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. The Following User Says Thank You to jscheuer1 For This Useful Post:

    sumcwan (07-27-2008)

  8. #7
    Join Date
    Jul 2008
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks!! It works!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •