i’m trying to collapse programatically a collapsible with a simple
JavaScript:
$( ".nuovoPaziente" ).trigger( "collapse" );
HTML:
<div data-role="collapsible" data-collapsed="false" data-theme="b" id="nuovoPaziente">
</div>
but it doesn’t work.
I have the lastest jquery mobile library 1.1.1. I’m sure the execution arrives to the trigger code for i have an alert before checking that it arrive to execute the code.
Any idea? ^^
You used an
IDin your definition of your collapsible:So, it should be
#nuovoPazienteinstead:.nuovoPazienteis related to aclass; so if you want to keep this convention, you will have to modify your collapsible to something like this:The folowing example worked for me:
JS / jQuery:
HTML:
I called the libraries as follows:
You may have a try at the example above.
Hope this helps. Let me know about your results.