homepage Welcome to WebmasterWorld Guest from 54.198.130.203
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
function loading
convert onload to timeout
sssweb




msg:4402445
 6:28 pm on Dec 30, 2011 (gmt 0)

I have a working jQuery slideshow on my site. I also have a working script that sequentially loads elements on a page. I want to use the sequential loader on one of my slideshow pages.

The loader script is programmed to start on pageload (i.e. at the first slide); what's the best way to set it to start at the slide I want?

I don't want to use 'onclick' since the whole show is automated, so unless someone knows another way to trigger it when the correct slide comes up, I'm resorting to timeout, which I can't get to work.

Here's the working code:

$(window).load(function() {
$("#func_id").myfunc();
});

[The function is applied to <div id="func_id">]

Here's the non-working timeout I tried:

run_func {
$("#func_id").myfunc();
};

$(window).load(function() {
setTimeout(run_func, 10000);
});

I tested it using a simple alert in run_func and it still doesn't work, so it seems like something's wrong with the timeout.

 

sssweb




msg:4402467
 7:55 pm on Dec 30, 2011 (gmt 0)

I got this:

run_func {

should be:

function run_func() {

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved