I apologise for asking this question, have searched for and found several thread solving this question however I can never get the solutions given to work, I have no idea what I'm doing wrong.. could it possibly have something to do with using prototype/scriptaculous at the same time??
current classes that effect this problem in css file:
Philip M, when I tried your solution, it simply showed "show or hide the portfolio"... when it was clicked that text disappeared.... "Portfolio text - but don't display me yet" never showed up
abduraooft, so i place
Code:
<script type="text/javascript">
window.onload=function(){
var elm= document.getElementById('portfolio');
elm.className='shown';
}
</script>
in the head? what do i add to the onlick part of the link?
not sure wether this will help but this is the page where the about, portfolio and contact divs are hidden.. I need them to be shown when the appropriate link is clicked on the right
.... and here is the mess i am trying to fix by initially having those divs hidden
Last edited by 111buddy11; 03-16-2009 at 10:46 AM..
Philip M, when I tried your solution, it simply showed "show or hide the portfolio"... when it was clicked that text disappeared.... "Portfolio text - but don't display me yet" never showed up
[I]
I'm not sure why this is happening, as this works fine on its own:
Code:
<a href="#" onclick = "toggle()">Show or hide the portfolio</a>
<div id="portfolio" class = "hidden" style="display:none">
Portfolio text - but don't display me yet
</div>
<script type = "text/javascript">
function toggle(){
var divn1 = document.getElementById("portfolio");
if (divn1.style.display == "none") {
divn1.style.display = "block";
}
else {
divn1.style.display = "none";
}
}
</script>
however when I try to add it into the content already shown, the text "Show or hide the portfolio" is the only thing that disappears when it is clicked?
shown here ("Show or hide the portfolio" is located at the top of the text thats shown on page load)
Last edited by 111buddy11; 03-18-2009 at 10:01 PM..