Extends the Bootstrap Collapse plugin to allow automatic changing of both the target and parent element in the DOM.