Click here to Skip to main content
16,022,752 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In a div element block, I have several dijit.TitlePane like that

If I toggle one of them, I want others to be closed. I created a function:
onClick = "togglePanes(this)"
In this function, I want to setup set each pane's open property (like open="false"). But I could not get catch the element using either one of them below:
document.getElementById["tocPane"] // undefined
document.forms[0].getElementById["tocPane"] // is null or not an object
How to catch the pane element? Thanks.
Posted

i think you should incorporate the standard jQuery libs to your javascript/html codes like these

<script type="text/javascript" src="jquery.js">

$(document).ready( function() {

} );

$('#tocPane').open = false;

. . .

</script>

jQuery is a small compact built javascript library that can be include to your web design project that merely based on javascript/html but i couldn't explore the many details of jQuery here, i think you should make visit to the jQuery official site at http://jQuery.com
 
Share this answer
 
v2
Comments
[no name] 3-Feb-14 14:27pm    
I created a function
function togglePanes(pane) {
if (pane.id == "segmentPane") {
document.getElementById("pointPane").open = false;
} else if (pane.id == "pointPane") {
document.getElementById("segmentPane").open = false;
} else { }
}
But I can't set another pane off. Anything wrong in this code?
Tried document.getElementById("tocPane") it works.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900