I am using a jQueryMobile (v1.4.0) collapsible set / accordions to display a list of elements and its content as shown in this jsFiddle.
Once a collapsible is expanded, retrieve its' .offset().top
and $.mobile.silentScroll()
to that position.
$(document).on("expand", "[data-role=collapsible]", function () {
var position = $(this).offset().top;
$.mobile.silentScroll(position);
});
Update: For jQuery Mobile 1.4, use collapsibleexpand
event.
Demo - jQM 1.0 - 1.1
Demo - jQM 1.2 - 1.3
Demo - jQM 1.4