Move sidebar to top on mobile

P Started by Paul · August 16, 2023 at 4:59 pm · 3 replies 0 voices Last reply 2 years, 10 months ago
P
Paul Original poster Member
#1

Website is currently still in development, running on localhost. I want to move the sidebar to top on mobile. The sidebar has to be on the right side on desktop, but want to have it on top on mobile. Prefer to do this with jQuery also.

P
Paul Original poster
#2

Solved it using code below.

(function($) {
if ($(window).width() < 991) {
$("#woo-sidebar-wrapper").insertBefore("#woo-products-wrapper");
}
})(jQuery);
P
Paul Original poster
#3

Not working as it should. With the CSS below it does, but prefer jQuery to get it working.

@media only screen and (max-width: 991px) {
.page-content-area > .row {
display: flex;
flex-direction: column-reverse;
}
}

Post a reply

Join the conversation. Be kind — this is a public forum.

Replying to Move sidebar to top on mobile

By posting, your reply becomes public (unless marked private).