dennylin93 Posted February 14, 2007 Share Posted February 14, 2007 I was trying to make a hide/show function with JS, but I got stuck. I was trying to make it like the ones on Wikipedia: http://en.wikipedia.org/wiki/TaipeiEx. Can anyone help me with this? Thanks in advance. Link to comment Share on other sites More sharing options...
dennylin93 Posted February 14, 2007 Author Share Posted February 14, 2007 Never mind. I found out after I fiddled with it for a few hours. Link to comment Share on other sites More sharing options...
Anders Moen Posted February 14, 2007 Share Posted February 14, 2007 Post script maybe? Link to comment Share on other sites More sharing options...
Skemcin Posted February 14, 2007 Share Posted February 14, 2007 I've posted several snippets here already:http://w3schools.invisionzone.com/index.php?showtopic=9500 Link to comment Share on other sites More sharing options...
Lepper Posted February 22, 2007 Share Posted February 22, 2007 To show or hide some thing in your page use the property .style.display in the element you want to show/hide... for example: <script type="text/javascript">function showHide(id){var element = document.getElementById(id); try{ if(element.style.display == "none") {element.style.display = "";}} catch (e) { //do something if the id provided doesn-t obtain an element from your document}} PD: you can replace line <element.style.display = "";> with element.style.display = "block"; too Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now