Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Why does this work intermittently?

    It is a page of thumbs. Click on a thumb and a display pops up allowing user to view pix in sequence by clicking a button.

    the first 15 thumbs are active - numbers 0 - 14.
    Sometimes it won't show any. Sometimes it will show the first 4, or the first 12, then just stop working.

    [URL="http://www.zootgeist.com/allhouston/thumbs1.html"]

    You can view source to see code.
    My first post, sorry if it does not conform.
    Thank you

  • #2
    Senior Coder
    Join Date
    Sep 2010
    Posts
    1,912
    Thanks
    15
    Thanked 227 Times in 227 Posts
    a href="avascript:void(0)" an error that shows up in three places.

    It looks pretty but the code is really poor. You're using javascript.void(), you have an array but you're not using the array to any advantage in the coding so you have a lot of redundant code, all not good.

    You could use 'this' functionality with the array, and reduce all the code below the body tag to a few lines, and have everything work well.

  • Users who have thanked DrDOS for this post:

    3591wjr (09-08-2012)

  • #3
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    reply to why working intermittently

    Thanks for the reply. I am certainly not going to argue about my code. I will look up the "this" technology.
    But how am I not using the array to its best advantage?
    I use it to preload, and then reference it to change the image.
    I am not trying to be defensive, but am very curious.
    Thanks.



    Code:
    document.getElementById('holder').style.backgroundImage="url(" + picArray[x] + ")";


  •  

    Posting Permissions

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