Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-08-2012, 03:31 PM   PM User | #1
3591wjr
New to the CF scene

 
Join Date: Sep 2012
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
3591wjr is an unknown quantity at this point
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
3591wjr is offline   Reply With Quote
Old 09-08-2012, 03:59 PM   PM User | #2
DrDOS
Senior Coder

 
Join Date: Sep 2010
Posts: 1,155
Thanks: 10
Thanked 148 Times in 148 Posts
DrDOS is infamous around these parts
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.
DrDOS is offline   Reply With Quote
Users who have thanked DrDOS for this post:
3591wjr (09-08-2012)
Old 09-08-2012, 11:24 PM   PM User | #3
3591wjr
New to the CF scene

 
Join Date: Sep 2012
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
3591wjr is an unknown quantity at this point
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] + ")";
3591wjr is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:08 AM.


Advertisement
Log in to turn off these ads.