Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 08-11-2009, 03:14 PM Image Rotation
TripleMoons's Avatar
Webmaster Talker

Posts: 614
Name: Stephanie Kunder
Location: Hanover, PA
Trades: 0
Anyone want to hazard a guess why my images for the javascript rotation disappeared? It's supposed to be appearing in the left column after the static dog.

http://triplemoonsdesign.com/YCDTC/

HTML:
Code:
<script type="text/javascript">
                showImage();
                </script>
External Javascript:
Code:
var theImages = new Array()

theImages[0] = 'images/rotatebottom/1.png'
theImages[1] = 'images/rotatebottom/2.png'
theImages[2] = 'images/rotatebottom/3.png'
theImages[3] = 'images/rotatebottom/4.png'
theImages[4] = 'images/rotatebottom/5.png'
theImages[5] = 'images/rotatebottom/6.png'
theImages[6] = 'images/rotatebottom/7.png'
theImages[7] = 'images/rotatebottom/8.png'
theImages[8] = 'images/rotatebottom/9.png'
theImages[9] = 'images/rotatebottom/10.png'
theImages[10] = 'images/rotatebottom/11.png'
theImages[11] = 'images/rotatebottom/12.png'
theImages[12] = 'images/rotatebottom/13.png'
theImages[13] = 'images/rotatebottom/14.png'
theImages[14] = 'images/rotatebottom/15.png'
theImages[15] = 'images/rotatebottom/16.png'
theImages[16] = 'images/rotatebottom/17.png'
theImages[17] = 'images/rotatebottom/18.png'
theImages[18] = 'images/rotatebottom/19.png'
theImages[19] = 'images/rotatebottom/20.png'
theImages[20] = 'images/rotatebottom/21.png'
theImages[21] = 'images/rotatebottom/22.png'
theImages[22] = 'images/rotatebottom/23.png'
theImages[23] = 'images/rotatebottom/24.png'
theImages[24] = 'images/rotatebottom/25.png'
theImages[25] = 'images/rotatebottom/26.png'
theImages[26] = 'images/rotatebottom/27.png'
theImages[27] = 'images/rotatebottom/28.png'
theImages[28] = 'images/rotatebottom/29.png'
theImages[29] = 'images/rotatebottom/30.png'
theImages[30] = 'images/rotatebottom/31.png
theImages[31] = 'images/rotatebottom/32.png
theImages[32] = 'images/rotatebottom/33.png
theImages[33] = 'images/rotatebottom/34.png
theImages[34] = 'images/rotatebottom/35.png
theImages[35] = 'images/rotatebottom/36.png
theImages[36] = 'images/rotatebottom/37.png
theImages[37] = 'images/rotatebottom/38.png
theImages[38] = 'images/rotatebottom/39.png
theImages[39] = 'images/rotatebottom/40.png
theImages[40] = 'images/rotatebottom/41.png'
theImages[41] = 'images/rotatebottom/42.png'
theImages[42] = 'images/rotatebottom/43.png'
theImages[43] = 'images/rotatebottom/44.png'
theImages[44] = 'images/rotatebottom/45.png'
theImages[45] = 'images/rotatebottom/46.png'
theImages[46] = 'images/rotatebottom/47.png'
theImages[47] = 'images/rotatebottom/48.png'
theImages[48] = 'images/rotatebottom/49.png'
theImages[49] = 'images/rotatebottom/50.png'

// do not edit anything below this line

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

TripleMoons is offline
Reply With Quote
View Public Profile Visit TripleMoons's homepage!
 
 
Register now for full access!
Old 08-14-2009, 02:41 PM Re: Image Rotation
TripleMoons's Avatar
Webmaster Talker

Posts: 614
Name: Stephanie Kunder
Location: Hanover, PA
Trades: 0
No one knows?
No one has a alternative to suggest?
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

TripleMoons is offline
Reply With Quote
View Public Profile Visit TripleMoons's homepage!
 
Old 08-14-2009, 05:46 PM Re: Image Rotation
Extreme Talker

Posts: 238
Location: United States
Trades: 0
You have syntax errors in your JavaScript. Specifically look at these lines:
Code:
theImages[30] = 'images/rotatebottom/31.png
theImages[31] = 'images/rotatebottom/32.png
theImages[32] = 'images/rotatebottom/33.png
theImages[33] = 'images/rotatebottom/34.png
theImages[34] = 'images/rotatebottom/35.png
theImages[35] = 'images/rotatebottom/36.png
theImages[36] = 'images/rotatebottom/37.png
theImages[37] = 'images/rotatebottom/38.png
theImages[38] = 'images/rotatebottom/39.png
theImages[39] = 'images/rotatebottom/40.png
You should add a closing quote to these lines.

As a side note, you may want to enable JavaScript error reporting in your browser (if it's IE); for Safari, enable the developer tools; or for Firefox, install Firebug.
__________________
The interlocking pieces of web development: usability, performance, accessibility, and standards.
frost is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Image Rotation
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.48884 seconds with 12 queries