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
Autostarting slideshow?
Old 05-16-2009, 02:25 AM Autostarting slideshow?
MellowD's Avatar
Average Talker

Posts: 15
Trades: 0
I'm trying to have the slideshow start as the page loads and can't figure it out. I tried messing with the true/false but no luck. Any help would be great!

<script language="JavaScript">
<!-- Begin
NewImg = new Array (
"img link"
"img link"
"img link"
);
var ImgNum = 0;
var ImgLength = NewImg.length - 1;

//Time delay between Slides in milliseconds
var delay = 2550;

var lock = false;
var run;
function chgImg(direction) {
if (document.images) {
ImgNum = ImgNum + direction;
if (ImgNum > ImgLength) {
ImgNum = 0;
}
if (ImgNum < 0) {
ImgNum = ImgLength;
}
document.slideshow.src = NewImg[ImgNum];
}
}
function auto() {
if (lock == true) {
lock = false;
window.clearInterval(run);
}
else if (lock == false) {
lock = true;
run = setInterval("chgImg(1)", delay);
}
}
// End -->
</script>
MellowD is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-18-2009, 10:01 PM Re: Autostarting slideshow?
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
Wow, no offense (really) but you are an obvious javascript newbie, you need to checkout the setInterval method of javascript!, also arrays and other objects... You are really re-inventing the wheel! E-mail me if you want some assistance.
__________________
Sleeping Troll, EMUSE, Mind Expansion...Truly serendipity!
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Autostarting slideshow?
 

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.28774 seconds with 12 queries