Then you can do something like this:

Have a setTimeout (say, executes in 20 seconds) with a callback
function, say "moveToLocation".

Then you need a way to find out whether the div has been scrolled to
the certain location or not. That can be done by checking either for
the user's top/left coordinate of their screen, or you can set a
variable when the user clicks on that "button".

After the 20 seconds comes by and the moveToLocation function is
called, it checks for that location (or some variable you set). If
it's true (meaning, the user has scrolled to the certain location),
then do nothing. Otherwise, do the auto-scroll.

The idea is that the moveToLocation is called no matter what. It's
just that whether you do the actual action or not depends on the state
of things.


On Aug 6, 12:09 pm, Simon Vansintjan <svansint...@gmail.com> wrote:
> Well, it's pretty theoretical at the moment, so there's no code down, but
> the idea would be that a div appears, and that the user can click on a
> button that would scroll the div to a certain location. However, if the user
> doesn't click, I would still want the div to move to that location (in case
> he/she doesn't get it that it would move, dunno).
>
>
>
> On Thu, Aug 6, 2009 at 6:03 PM, James <james.gp....@gmail.com> wrote:
>
> > Use the setTimeout/setInterval functions with some kind of global
> > counter. If some kind of action/event occurs, the counter would be
> > refreshed and the function would not execute.
> > Would you like to specify in more detail what you would like to
> > achieve?
>
> > On Aug 6, 11:43 am, Simon <svansint...@gmail.com> wrote:
> > > Hey,
>
> > > After a user hasn't triggered an event for a given amount of purple,
> > > would it be possible to trigger that event anyway?
>
> > > I have no idea how to even start looking for this.
>
> > > Thanks for any hints/ideas/whatever you can throw my way.
>
> > > Simon
>
> --
> simon.vansintjan.org

Reply via email to