dimanche 6 juillet 2014

I need these buttons to control which div is showing or "on top"


Vote count:

0




I have these buttons on the side of my page, and a main content area taking up the better part of the page.


What I am trying to do is get the button I click to change the main content to a div containing the corresponding information. This is very hard to find, perhaps because I am searching by the wrong terms, and I have covered a good portion of stackoverflow without much luck.


I have though about absolutely positioning the divs and using a script to change the z-index of the the divs to the highest amount using a "=+1" type situation, but I could see that getting messy.


I have considered adapting a script I have that replaces part of an image file name in order to change a main picture on a page to a larger version of the image corresponding to a thumb name, though this script targets file names so it isn't going well.


I have also tried something along the lines of:


"id of button" onclick function = "main content class" change id to "corresponding div"


only in javascript talk, and this isn't working at all so I can only assume that I am either looking at it wrong or I have some messed up in the code.



$('#tabhead1').click(function() {


document.getElementByClassName("maintab").id = "tabs1"; });


This is driving me crazy and I would really appreciate some ideas. I tried to leave it free formed so that noone gets hung up on anyone solution.




gillesc

3,503

asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire