Site logo

Archived topic

Off Canvas Panel Switching Sides Desktop and Mobile

3 replies · Started by Joe on November 11, 2019

Viewing posts 1–4 of 4

Hi there.

Is this possible for the Off Canvas Panel?

On the desktop, the hamburger is on the left so the panel slides in from the left. As needed.

Yet on the mobile, the hamburger is on the right so better CX would be to have it slide in from the right (mobile only).

Is it possible to set the direction based on the device?

Thanks,
Joe

Hi there,

try this CSS:

@media (max-width: 768px) {
    .offside--left {
        left: auto;
        right: -265px;
    }

    .offside--left.is-open,
    .offside-js--is-left .offside-sliding-element {
        -webkit-transform: translate3d(-265px, 0, 0);
        -moz-transform: translate3d(-265px, 0, 0);
        -ms-transform: translate3d(-265px, 0, 0);
        -o-transform: translate3d(-265px, 0, 0);
        transform: translate3d(-265px, 0, 0);
    }

    .offside-js--is-left.slide-opened .slideout-overlay button.slideout-exit {
        left: unset;
        right: 260px;
    }
}

Like a charm. Thank you!

Happy to be of help

This archived topic is closed to new replies.