CassidyHunt
IS-IT--Management
I have a list of elements with display on and off options. When the element disappears the rest of the elements won't shift up to replace the void from the previous object.
Is there anyway to fix this?
here is my code
If you click on middle div button it disappears fine but div3 does not shift up. I actually have around 20 items I would like to do this with and make a clean list everytime.
What is the best approach?
Thanks
Cassidy
Is there anyway to fix this?
here is my code
Code:
<script language="javascript">
function toggleDisplay(e){
alert(e);
element = document.getElementById(e).style;
if (element.display=='none') {element.display='block';}
else {element.display='none';}
}
</script>
<div id="something2">
<input type="button" value="Click Me" onclick="toggleDisplay('something')">
</div>
<div id="something">
<input type="button" value="Click Me" onclick="toggleDisplay('something2')">
</div>
<div id="something3">
<input type="button" value="Click Me" onclick="toggleDisplay('something3')">
</div>
If you click on middle div button it disappears fine but div3 does not shift up. I actually have around 20 items I would like to do this with and make a clean list everytime.
What is the best approach?
Thanks
Cassidy