Welcome to WebmasterWorld Guest from 54.146.174.220

Forum Moderators: open

function loading

convert onload to timeout

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

5+ Year Member



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.
7:55 pm on Dec 30, 2011 (gmt 0)

5+ Year Member



I got this:

run_func {

should be:

function run_func() {
 

Featured Threads

Hot Threads This Week

Hot Threads This Month