Call function multiple times on click to make subsequent collapsible full screen

Call function multiple times on click to make subsequent collapsible full screen

I am new to jquery mobile and programming in general. I have spent hours trying to figure out how to make my "two" nested collapsible full screen when clicked like "one" without having to give it a separate ID and javascript. I tried unsuccessfully to call the function for #foo to run with each click for separated nested collapsibles.

ALSO, I have added functionally to scroll expanded collapsible to top of screen. However, this only works for the 1st button. How do I hide other collapsibles within a set when one is open?


Any help is appreciated, especially with the first issue.

http://jsfiddle.net/celltech2000/pyg01yux/