Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
jQuery Mobile collapsible sets. Move content to the top
* Attach a handler to collapsible sets.
* Attach a handler to every collapsible (filtered by their jQM’s role) so that,
* every time a collapsible’s header is tapped, it will scroll to the top of the page (both header and content)..
* @link
$(document).on('pagebeforeshow', function()
collapse: function(event, ui)
expand: function(event, ui)
jQuery('html, body').animate(
scrollTop: jQuery(this).offset().top - 10
}, 500);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.