But what I need is another 2 buttons to make it 3, and two more div’s holding new content in each. Sp click click a button the corresponding text appears, click the next button that previous div slides back up and the new text appears and so on.
I think what I need to add to is that the div doesnty move, all 3 have to be in exactly the same place, so ideally you only have the one div and just the content changes, but im not sure how this can be done
Thanks for the reply, but what your showing how to do is a drop down menu, when what I need is the 3 buttons like you have it, but rather than a drop down nav buttons, what I need is three buttons and on click it shows text that has been hidden.
then when you click say button 2, the text revealed by clicking button 1 slides away and the new text appears.
Its a show and hide problem, where you got 3 buttons, ideally 1 text area that gets populated with text in relation to each button.
I think so yes, but how does the jscript determine which div to show when they click one of the three buttons.
I’m developing it here, and first off I think there seems to be conflict with other script files.
But basically you’ll see the three buttons as they have red around them, and then I have only put the one sliding div in for now, and thats not working at the moment, and if I can get it to work I need to add another 2 div’s with their own content that relates to the button.
In my example the div that is revealed is the next() div and it reveals that one. If you are placing the revealed elements in another location then you will need to target them by id or some other method. You could use the href of the anchor to supply the id and then show that item.
I’m just out for a few hours but I will knock up an example unless someone else wants to jump in
Apologies i missed this reply, But @Paul_Wilkins & @PaulOB got way better answers! @Paul_Wilkins am taking your code & putting on codepen because i like it and want to play with. Hope it’s ok, of course I am attributing.