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.

inside custom component

Web and WebWorks Development

Reply
Developer
Posts: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
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?

_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis
Developer
Posts: 34
Registered: ‎05-20-2012
My Device: Playbook
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

 

Highlighted
Developer
Posts: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
My Carrier: wifi

Re: JQMobile - Collapse Content with Javascript

Works perfectly. Thanks!
_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis