I see to be having issues using this Javascript code to make a list of download options appear and disappear accordingly based on their visibility when triggered: If it's visible, it will be hidden. If it's hidden, it will be visible.
window.openList = function(listName) {
var list = document.getElementById(listName + "-list");
if (list.style.visibility == "hidden") {
list.style.visibility = "visible";
} else if (list.style.visibility == "visible") {
list.style.visibility = "hidden";
}
}
Here's the html that will be interacting with the Javascript:
<div id="downloads">
<div id="redtech-gpu-download" class="downloads">
<p onclick="javascript: openList('redtech-gpu-download');">Redtech GPU</p>
<div id="redtech-gpu-download-list" class="download-list">
<span class="download-list-item download-list-item-a">
<p onclick="javascript: window.open('files/redtech-gpu-001.zip', '_blank');">GPU Ver 0.0.1 Alpha</p>
</span>
<span class="download-list-item download-list-item-b">
<p>{ More Coming Soon! }</p>
</span>
</div>
</div>
<div id="redtech-memory-download" class="downloads">
<p onclick="javascript: openList('redtech-memory-download');">Redtech Memory</p>
<div id="redtech-memory-download-list" class="download-list">
<!--<span class="download-list-item download-list-item-a">
<p onclick="javascript: window.open('files/redtech-memory-001.zip', '_blank');">Memory Ver 0.0.1 Alpha</p>
</span>-->
<span class="download-list-item download-list-item-b">
<p>{ Coming Soon! }</p>
</span>
</div>
</div>
</div>
visibilityin your CSS?style.visibilitywill only work for inline styles. You should use getComputedStyle to read the computed CSS styles