#738·barba

Change the wrapper/container on the fly?

Author: louiswalchCreated Jun 13, 2024Updated Jun 27, 2024
Labelsquestion

Is it possible to dynamically change the wrapper and container element when a link is clicked, to load a sub part of the page?

Back in v1 of Barba this was possible in the linkClicked hook and then resetting it after load is complete. But I can't figure out how to do it in v2.

    Barba.Pjax.Dom.wrapperId        = name + '-wrapper';
    Barba.Pjax.Dom.containerClass   = name + '-container';

(If anyone stumbles on this, the code above is example of how it was done in v1, this isn't a v2 solution)