The coding is a bit messy and all over the place so forgive me for that, but I’m in a rush to finish this ASAP. Now with that little disclaimer out of the way…
I’ve been asked to create a form that has 3 layers of seperation that you can navigate using two menus – a layer of tabs at the top to navigate the first level. Then the side menu will allow the user to navigate the question fields another level down, with the final level being an accordion display of questions. It has to be done this way, my clients as stubborn as they are refuse it to be done another way. It also has to completely be IE6 compatible ><
You can see my code dump here: jsFiddle
Alright. The issue. Whats happening is that firstly, when clicking the tabs at the top you should be able navigate between the two tabs I have as examples, this worked in jquery v.3 but now it hides the current tab along with the other. I have no idea whats going. The other is exactly the same regarding the side menu, instead of showing the next selected questions it just hides them aswell.
I’ve been working on this for ages to the point where I can’t make anything of it. If anyone can lend a fresh set of eyes or at least point me in the right direction here that would be great. Again, sorry for the state of my code, this is my first attempt at something like this.
Cheers!
it seems like your
tabvariable you pass to selectedTab gets the complete url prepended to it. so#tab1for example becomeshttp://fiddle.jshell.net/pPgzg/2/#tab1on jsfiddle.I added a quick fix to selectedTab, that seems to fix it.
http://fiddle.jshell.net/pPgzg/2/
i checked it again and found out the problem i described above can be prevented if you use
.attr('href');instead of.prop('href');.The other thing, which i think is also responsible for a couple of problems is, that you have duplicate IDs. IDs have to be unique. Now if you do
$('#question1')for example, can’t know which question will be opened.