Thimo-12
psychic stalker
It's still not clear what you're trying to do.
What do you mean by making the background move?
actually i don't know how can i explain more...but i will try again...
this list or menu is consist of 5 grey buttons
when you move your mouse pointer over each button , the blue image
appear as a background of this button...&
disappear & the button back to the grey color when the mouse pointer move away....i can do it easily by Html & Css....
I must use Jquery or JavaScript to make this menu more dynamic...to make this blue image shown on the top 1st button then disappear.. & appear on the 2nd button after 2 sec...& disappear again & appear on the 3rd one...etc... & back again on the 1st one...automatically.
still not clear ?
This is
much more clear.
To do this, you'd set up:
setInterval(function(){ toggleNextButton() ; }, 2000) ;
... And write a function that does the heavy lifting. You can even pause the interval when the user selects one by storing the return value of setInterval() and calling clearInterval() on it.
The function would probably look a little like this:
var $selectedButton = null;
var toggleNextButton = function () {
if(!$selectedButton) {
$selectedButton = $('#firstButton') ;
} else {
$selectedButton = $selectedButton.siblings($selectedButton.id()+'+.button') ;
}
$selectedButton.addClass('selected') ;
$selectedButton.siblings('.button').removeClass('selected') ;
// whatever else you need to do.
}
The general form is like this, but only the IDs and classes you use will likely differ.