function ToggleCollapsible(ControlIdToShow, SaveStateField, ControlFireID) {
var control = document.all[ControlIdToShow].style;
var expandstate = document.all[SaveStateField];
var ControlFireID = document.getElementById(ControlFireID);
if (control.display == 'none') {
control.display = '';
expandstate.value = 'true';
if (ControlIdToShow == "ToShow") {
//showImageID.style.display = "none";
//hideImageID.style.display = "block";
//On button click change the image
ControlFireID.src = "Collapsible/collapse.gif";
ControlFireID.title = "Hide";
}
}
else {
control.display = 'none';
expandstate.value = 'false';
if (ControlIdToShow == "ToShow") {
//showImageID.style.display = "block";
//hideImageID.style.display = "none";
//On button click change the image
ControlFireID.src = "Collapsible/expand.gif";
ControlFireID.title = "Show";
}
}
return false;
}
<input type="hidden" name="CollapsiblePanelHidden" value="True" />
<input id="imgBtnShow" name="imgBtnShow" type="image" src="Collapsible/expand.gif"
onclick="return ToggleCollapsible ('ToShow', 'CollapsiblePanelHidden', 'imgBtnShow')"
title="Show" style="display: block;" />
<div id="ToShow" style="display: none;">
<table id="ShowTable">
<tr>
<td>
<a id="ShowTableContent"
title="Click to expand/collapse" onclick="return ToggleCollapsible ('PanelToShowOrHide', 'CollapsiblePanelHidden', 'imgBtnShow', 'imgBtnHide')"
href="#">Collapsible panel (click to expand).</a></td>
</tr>
<tr>
<td id="PanelToShowOrHide" style="width: 100%; display: none; color: Red;">
http://asp-tech.blogspot.com/
</td>
</tr>
</table>
</div>
No comments:
Post a Comment