johnb41 Posted September 13, 2008 Share Posted September 13, 2008 I have a Dreamweaver Spry CollapsePanel which i want to open and close programatically via javascript.I can open the CollapsePanel with the ID hard coded in:CollapsiblePanel1.open(); // this works... but i need to do this programatically, and this doesn't work:var x = document.getElementById("CollapsiblePanel1");x.open(); // does not workIt's critical that i have to do it with a variable. Can anyone help?Thanks!John Link to comment Share on other sites More sharing options...
Ingolme Posted September 13, 2008 Share Posted September 13, 2008 Is this "CollapsiblePanel1" an HTML element or just Javascript? Link to comment Share on other sites More sharing options...
johnb41 Posted September 13, 2008 Author Share Posted September 13, 2008 Is this "CollapsiblePanel1" an HTML element or just Javascript?It's the ID of a DIV: <div id="CollapsiblePanel1"> <div class="CollapsiblePanelTab"></div> <div class="CollapsiblePanelContent"></div> </div> // all the magic behind this collapsepanel is done with an attached javascript file supplied by AdobeAs in the original post, if i use getElementById, and put the result into a variable, the "open" command does not work. But if i do the "open" command directly on the ID, then it does work!! What's going on?Thanks!John Link to comment Share on other sites More sharing options...
Ingolme Posted September 13, 2008 Share Posted September 13, 2008 I don't know anything about Dreamweaver's libraries, but most likely the open() method is attached to the variable and not the element. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.