Hi,
I'm developing an intranet site using Dreamweaver and, as a newbie, I don't have lots of experience. I'm trying to create an expandible/collapsible list using HTML/CSS. For example, in the following list I want the user to be able to click on "Procedures", which would then expand to display the documents.
Procedures
Document 1
Document 2
Templates
Document 1
Document 2
I've tried several solutions that I found online, but haven't had any luck. Does anyone have any recommendations?
</div> </div> <div id="exampleSlider" style="position:absolute;top:18px;left:0px; width:250px;height:232px;background-color:#A6BBCD; border:1px solid #FFFFFF;color:#000000;overflow:hidden;"> <p> Click the 'X' in the top-right corner to expand and contract this sliding panel. </p> </div> </div>
function showMore(link_id,elemId) { linkObj = document.getElementById(link_id); //display the more content for this elemId document.getElementById(elemId).style.display='block'; //change the links attributes to hide the more content linkObj.href = 'javascript:hideMore("'+link_id+'","'+elemId+'")'; linkObj.innerHTML = "Show less"; }
function hideMore(link_id,elemId) { linkObj = document.getElementById(link_id); //hide the more content for this elemId document.getElementById(elemId).style.display='none'; //change the links attributes to show the more content linkObj.href = 'javascript:showMore("'+link_id+'","'+elemId+'")'; linkObj.innerHTML = "Show more"; }
I'm new too, and I think this is a similar query to the one I have. I too am using Dreamweaver, though in code view.
I'm trying to develop some help pages and would like to use some sort of expanding page
For example:
I can't login >> Do you have an account? >> Yes (answer)
>> No (Answer)
Does this solve your problem? Yes/No (as appropriate).
I have a few such questions which I'd like to display, and when the user clicks on the relevant problem, the first question will appear, and depending on whether they answer yes or no, the next step in the process will appear.
Personally I think AJAX would work best here but as a beginner that won't help much. A series of linked pages is by far the easiest way to go.
Between those extremes would be Javascript revealing things depending on what was clicked on. That would be fairly easy (use CSS to visibility:hidden the content then Javascript to reveal the one you want shown via the DOM.).
If any of that made sense you are probably ready to have a go at it. I'd be happy to help but I am far from great at Javascript so it might be best to let someone else do it.
</div>
</div>
<div id="exampleSlider" style="position:absolute;top:18px;left:0px;
width:250px;height:232px;background-color:#A6BBCD;
border:1px solid #FFFFFF;color:#000000;overflow:hidden;">
<p>
Click the 'X' in the top-right corner
to expand and contract this sliding panel.
</p>
</div>
</div>
</body>
</html>
Thanks for this helpful code. I was wondering how you would have the content be hidden until you click on the X, instead of having it showing at first.
Bookmarks