Automatically Open Primary Menu on Small Screens

1 reply · opened Oct 20, 2016

YYSZOct 20, 2016

What is the best method to automatically open the menu on small screens e.g. .device-xxs/xs/sm/md, please?

I have tried to add the following to my custom app.js file - however, this only works on page refresh and not when page is loaded. I also tried the document ready.

Thanks.

$(window).bind("load", function() {
if ($("body").hasClass("device-xss") || $("body").hasClass("device-xs") || $("body").hasClass("device-sm") || $("body").hasClass("device-md")) {
$(".sf-js-enabled").addClass("show");
}
});

YYSZOct 21, 2016

This code actually works after further testing. No need for any other feedback. Thanks.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard