Assuming mootools is included you could do something like this in
a .js file or script tags: (untested)
window.addEvent('domready', function()
{
var timer = 0;
var left_div = $('left');
var right_div = $('right');
var clear_timer= function()
{
timer = 0;
}
//if your mouse enters the left or right div counter = 0
left_div.addEvent('mouseenter', clear_timer);
right_div.addEvent('mouseenter', clear_timer);
var increase_counter = function()
{
timer++;
if(timer == 6)
{
window.location = "http://www....";
}
}
//set the counter to go up 1 every 10secs
increase_counter.periodical(10000);
});
On Sep 12, 2:55 pm, Philip Arndt <[EMAIL PROTECTED]> wrote:
> Hi,
>
> You'd want to have a function which was onmousemouve and/or onkeypress
> which was something like:
>
> function redirect()
> {
> window.location = '/index.php';
>
> }
>
> function recordMovement()
> {
> window.clearTimeout();
> window.setTimeout(redirect, 3600);
>
> }
>
> this would depend which browser you were in, google for the syntax per
> browser.
> this would also kill any other timeouts associated with window.
>
> Cheers,
>
> Phil
>
> On 12/09/2008, at 2:17 PM, Paul Gutch - JoomlaNZ wrote:
>
>
>
> > Hello
>
> > I am building a Joomla site for a Kiosk Directory
> > I am looking for some code that will redirect to the home page
> > after a
> > set amount of no screen activity.
> > Either PHP or Javascript I assume.
> > Have found some possible solutions from searching but I'm sure someone
> > on this list would have the perfect solution.
>
> > Thanks
> > Regards
> > Paul
--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---