abemaca Posted March 15, 2012 Share Posted March 15, 2012 hi all , heres my code ..... <script type="text/javascript"> function showLayer(name) { name.style.display = "block"; } function hideLayer(name) { name.style.display = "none"; } </script> Example click <span onclick="showLayer(thisone)" style="cursor:hand"><b>here</b></span><br> <div id="thisone" style="position: top:100; left:10; absolute;display:none;"> Some text or other stuff <br> <a href="#null" style="cursor:hand" style="text-decoration:none;" onclick="hideLayer(thisone)">[ hide ] </a> </div> <p> Example click <span onclick="showLayer(sone)" style="cursor:hand"><b>here</b></span><br> <div id="sone" style="position: absolute; display:none;">Some text or other stuff <br><a href="#null" style="cursor:hand" style="text-decoration:none;" onclick="hideLayer(sone)">[ hide ]</a> </div> <p> How can i make auto hide and open section by clicking another hidden ??? IE: i have this script above running 4 times on the page , menu1 - menu2 - menu3 - menu4 if i click menu1 it shows menu1 text , then if i click menu2 it will hide menu1 and show menu2. at the moment the script will leave any open menus showing. Thanks in advance for any help. Quote Link to comment https://forums.phpfreaks.com/topic/259008-force-hide-a-hidden-text/ Share on other sites More sharing options...
sunfighter Posted March 15, 2012 Share Posted March 15, 2012 We are not going to do your coding. At lest try to learn CSS. look here: http://www.w3schools.com/css/css_display_visibility.asp Quote Link to comment https://forums.phpfreaks.com/topic/259008-force-hide-a-hidden-text/#findComment-1327852 Share on other sites More sharing options...
abemaca Posted March 15, 2012 Author Share Posted March 15, 2012 my bad sunfighter , thought this was a help forum . ill try elsewhere. Quote Link to comment https://forums.phpfreaks.com/topic/259008-force-hide-a-hidden-text/#findComment-1327868 Share on other sites More sharing options...
sunfighter Posted March 16, 2012 Share Posted March 16, 2012 We are a help form, but the code you posted is what I gave you in answer to a different problem you had. If you don't try to add the code you need to get things working the way you want; you are not asking for help, but for someone to do your work. Quote Link to comment https://forums.phpfreaks.com/topic/259008-force-hide-a-hidden-text/#findComment-1328215 Share on other sites More sharing options...
abemaca Posted March 16, 2012 Author Share Posted March 16, 2012 We are a help form, but the code you posted is what I gave you in answer to a different problem you had. If you don't try to add the code you need to get things working the way you want; you are not asking for help, but for someone to do your work. dude i pasted this code (that you gave me) as it was on the other page , i have edited it and my version is different just this way was fastest and showed the least details making solving the issue easier. i didnt mean to offend you as i obviously did mate and for that i do apologies. untill 2weeks ago i didnt know nothing about java , i can do html,php,MySQL and untill now thats all ive used. now im toying with new stuff and just wanted a simple answer , sorry for not knowing what you guys know but trust me , i AM trying Quote Link to comment https://forums.phpfreaks.com/topic/259008-force-hide-a-hidden-text/#findComment-1328231 Share on other sites More sharing options...
abemaca Posted March 25, 2012 Author Share Posted March 25, 2012 ive tried adding the 'onclick="hideLayer(thisone)"' to the link that opens the other options but it just stops the showlayer working Quote Link to comment https://forums.phpfreaks.com/topic/259008-force-hide-a-hidden-text/#findComment-1331018 Share on other sites More sharing options...
seanlim Posted March 27, 2012 Share Posted March 27, 2012 First off, there's no Java in there. it's Javascript. Totally different. Secondly, i don't think you are passing the object right from the onclick handler. I have not done "pure" javascript in awhile, but from what I recall, you can't simply pass the object by id as you have done in hideLayer(thisone). I would suggest trying onclick="hideLayer('thisone')" and in your function, do a document.getElementById("thisone").style.display = "none"; Quote Link to comment https://forums.phpfreaks.com/topic/259008-force-hide-a-hidden-text/#findComment-1331543 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.