// Set the FieldSet height method, support IE browser, Firefox // Parameter 1: pTableID, the id of the div or table inside the FieldSet // Parameter 2: pFieldSetID, the ID of the FieldSet // Parameter 3: pImageID , the ID of the picture, update the picture SRC after expanding or shrinking function FieldSetVisual( pTableID, pFieldSetID, pImageID ) { var objTable = document.getElementById( pTableID ) ; var objFieldSet = document.getElementById ( pFieldSetID) ; var objImage = document.getElementById( pImageID) ; if( objTable.style.visibility == 'visible' ) { objTable.style.visibility = 'hidden' ; objFieldSet.style.height = "22px" ; objImage.src="images/expand.png" ; } else { objTable.style.visibility = ' visible'; var heightFieldSet = parseInt( objFieldSet.style.height.substr(0,objFieldSet.style.height.length-2)) ; var heightTable = parseInt( objTable.offsetHeight ) ; objFieldSet .style.height = heightFieldSet heightTable "px" ; objImage.src="images/constringency.png" ; } }
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn