I am trying to make a slideshow-like thing with JavaScript for a website and it isn’t going well. What I want it to do is after one click change it so that it returns correctly.
Here is the code:
function previous_slide()
{
document.getElementById('banner').className = 'banner_2';
}
I’d like to make that single function switch between its current action and this one:
document.getElementById('banner').className = 'banner_1';
so that when you press the previous button once it changes the style to banner_2 and then when you press it again it returns to banner_1.
Code for
toggle