Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

hideelement javascript

edited August 2005 in Vanilla 1.0 Help
i'd like to use the exisiting "hideelement(blah,blah)" javascript vanilla already has included to hide/show the "whisper your comments to" box.... but i can't find where in the code this block of html is rendered! can anyone help?

Comments

  • MarkMark Vanilla Staff
    which block of html are you talking about?

    The HideElement function is pretty simple:
    function HideElement(ElementID, ClearElement) {
    	var Element = document.getElementById(ElementID);
    	if (Element) {
    		Element.style.display = "none";
    		if (ClearElement == 1) ClearContents(Element);
    	}
    }
    It finds any element in the page by it's ID and makes hit display: none. It also optionally clears the innerHtml out of the element.

    So, to make it work you'd just need to set up a link and then name the id of the element you want hidden. So, for example, if you wanted to hide the menu tabs, you'd do this:

    <a href="javascript:HideElement('MenuForum',0)">Hide the menu!</a>
  • ya... that's the one... i understand the javascript... i just don't know where to use it.... i.e. i don't know where the html for the "whisper comments to" input text is rendered.....
This discussion has been closed.