Ok, so I have:
function myfunc(foo,bar) {
$('#div' + foo).hide();
$('#div' + bar).show();
return false;
}
Then I have:
function myOtherFunc() {
// define vars foo and bar
myfunc(foo,bar);
}
var timerId = setInterval(myOtherFunc, 5000); // run myOtherFunc every 5 seconds.
which works fine. But the I have:
$('#myLink').click(function(){
// define vars 'foo' and 'bar'
myfunc(foo,bar);
return false;
});
Which doesn't work at all... What am I doing wrong?