Page 1 of 1

Expand/Contract Collapse Block with Javascript

Posted: Fri May 18, 2012 2:31 pm
by Chris2656882

I wish to dynamically collapse and expand a collapsible block.

I've used both:
Tiggr('collapsblock_options_holder').prop('data-collapsed', true) ;
Tiggr('collapsblock_options_holder').attr('data-collapsed', true) ;

However, the block does not collapse or expand.

Do I need to refresh the element? If so, how?


Expand/Contract Collapse Block with Javascript

Posted: Fri May 18, 2012 2:51 pm
by maxkatz

Use:

code
Tiggr(id).trigger('expand');
/code


Expand/Contract Collapse Block with Javascript

Posted: Thu Jan 02, 2014 8:03 pm
by araskin3i

I just tried Appery(id).trigger('expand') but it does not work. Has this changed?


Expand/Contract Collapse Block with Javascript

Posted: Thu Jan 02, 2014 8:35 pm
by Kateryna Grynko

Hi,

You can use this code: preAppery("mobilecollapsblock_10").trigger("collapse");
Appery("mobilecollapsblock_10").trigger("expand");/pre


Expand/Contract Collapse Block with Javascript

Posted: Mon Jun 16, 2014 7:49 am
by Aeneas McBurney

I tried the above and it doesn't seem to work. This is what I have with "collapseblockmatchopt" being at the top level of container.

Appery("collapseblockmatchopt").trigger("collapse");

Am I using the right level?

Thanks,
Aeneas


Expand/Contract Collapse Block with Javascript

Posted: Mon Jun 16, 2014 11:02 am
by Evgene Karachevtsev

Hello Aeneas,

Please clarify, what version of libraries do you use? For v2.0 these methods should be working:
http://api.jquerymobile.com/collapsib...
http://api.jquerymobile.com/collapsib...


Expand/Contract Collapse Block with Javascript

Posted: Mon Jun 16, 2014 10:02 pm
by Aeneas McBurney

Hi thanks for your prompt response.

I used Appery("collapseblockmatchopt").collapsible("collapse") and it worked like a charm.

Thanks again,
Aeneas