Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Collapsible Panel close function.

Status
Not open for further replies.

DaSe

Programmer
Feb 14, 2008
149
GB
Hi guys,
I just wonder why I can't get this simple script working...
I have a link ( anchor ) on a collapsible panel so when I click on it I don't want the panel to be opened but remain close ,however none of these functions work. Do you have any idea why ? Regards.

-----------------------

<a href="...." onClick="CollapsiblePanel1.close();">Register</a>
------------------------
 
what collapsible panel? can we see the code? Or are we supposed to guess what at what you are using?

Also how do you know the collapsible panel has a function named close()? If it does what does this function do?

We need more information. Is this collapsible panel is form some type of framework? If so which one?

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Hi.Ok here are the details:

It's a simple Spry collaspsible panel.
------------------------------------------
<script type="text/javascript">
<!--
var CollapsiblePanel1 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel1", {contentIsOpen:false});
//-->
</script>
------------------------------------------
 
Looking at the Spry explanation yes using the .close() function should indeed close the panel.

Provided your panel's name is actually CollapsiblePanel1.

And the location of your link has access to the CollapsiblePanel1 object.

You may find this example useful:

Perhaps someone who has worked more with Spry can help out more, as I am not very familiar with Spry.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Hi

Are you sure your problem is not that after [tt]close()[/tt]ing the panel successfully the browser follows the link and reloads the document with the panel's default state ?
Code:
[b]<a[/b] [maroon]href[/maroon][teal]=[/teal][green][i]"...."[/i][/green] [maroon]onClick[/maroon][teal]=[/teal][green][i]"CollapsiblePanel1.close();[highlight]return false[/highlight]"[/i][/green][b]>[/b]Register[b]</a>[/b]
Note that I know nothing about Spry.

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top