Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Web and WebWorks Development

Reply
Developer
Philipk
Posts: 489
Registered: ‎05-06-2012
My Carrier: wifi
Accepted Solution

JQMobile - Collapse Content with Javascript

[ Edited ]

I've created a collapsible div using the JQMobile BB Theme.  ( http://blackberry.github.com/jQueryMobile-BB10-Theme/kitchenSink/collapsible_blocks.html )

 

<div data-role="collapsible" data-iconpos="right" id="OnyomiDiv">

        <h1> Onyomi </h1>

        <p id="Onyomi"> Data </p>

</div>

 

Then I'm trying to collapse the content when it's open using Javascript with the follwoing 

 

$('#OnyomiDiv').trigger('collapse');

Has anyone been able to get something like this to work?

_________________________________________________________
Twitter: @PhilipK_ca
Please use plain text.
Developer
gnatok
Posts: 34
Registered: ‎05-20-2012
My Carrier: Vodafone

Re: JQMobile - Collapse Content with Javascript

Probably you try to trigger wrong element..

 

$('.ui-collapsible').trigger('collapse') - work perfect with your saple link

 

Please use plain text.
Developer
Philipk
Posts: 489
Registered: ‎05-06-2012
My Carrier: wifi

Re: JQMobile - Collapse Content with Javascript

Works perfectly. Thanks!
_________________________________________________________
Twitter: @PhilipK_ca
Please use plain text.