Off-canvas navigation menu for mobile only
Ivos
Registered Users Posts: 7 Big grins
Hello, I'm new to Smugmug and am working on getting the mobile version of my site to incorporate an "off-canvas navigation menu". Meaning that when someone clicks on the hamburger menu icon the menu slides in from the right side of the screen. I've done my due diligence in googling this before I posted on here but have only found CSS code to incorporate a hamburger menu and not the "off-canvas" action that I'm looking for. Is this something that can be done? Thanks!
0
Comments
There you go...
https://gallery.imagesinthebackcountry.com/Smugmug-customization/Off-Canvas-Navigation-Menu-For-SmugMug
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
This is a demo of what I'm looking to do https://codepen.io/iamsaief/pen/ExPoNjm
Haven't tried it, but if you don't enable the mobile menu, you should be able to hide the off-canvas menu using a media query in CSS. So the regular menu will display until the screen size shrinks to 736px (or what ever you want) and displays the off-canvas menu.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
Just add this in the CSS:
Smugmug uses 736px or smaller as a mobile, but you can change it to suit your needs.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
/*** Hamburger Menu for Mobile Devices****/
.sm-user-ui .sm-page-widget-logo .sm-page-widget-logo-align-left,
.sm-user-ui .sm-page-widget-logo .sm-page-widget-logo-align-right,
.sm-user-ui .sm-page-widget-logo .sm-page-widget-logo-align-center {
text-align: left;
}
.sm-user-ui .sm-page-widget-nav .sm-page-widget-nav-mobile .sm-page-widget-nav-menu-expand a.sm-h5 {
visibility: hidden;
}
.sm-user-ui .sm-page-widget-nav .sm-page-widget-nav-mobile .sm-page-widget-nav-menu-expand a.sm-h5:before {
font-family: 'SmugMug Icon Font Regular';
font-size: 35px;
width: 35px;
line-height: 10px;
content: '\E039 ';
display: block;
visibility: visible;
}
.sm-user-ui .sm-page-widget-nav .sm-page-widget-nav-mobile,
.sm-user-ui .sm-page-widget-nav-mobile .sm-page-widget-nav-mobile-header {
background: none;
}
.sm-user-ui .sm-page-widget-nav .sm-page-widget-nav-mobile .sm-page-widget-nav-menu-expand {
position: absolute;
top: -55px;/* adjust for your logo */
right: 10px;
z-index: 1;
}
.sm-user-ui .sm-page-widget-logo .sm-page-widget-logo-img,
.sm-user-ui .sm-page-widget-logo .sm-page-widget-logo-img-retina {
float: none;
}
.sm-user-ui .sm-page-widget-logo-text-container {
margin: 10px 0;
}
@media only screen and (max-width:3000px) {
.container {display: none;}
Since you reverted to Smugmug's mobile menu, the mobile break point is 736px. Screen size above 736px will display the "desktop" menu. Anything smaller than 736px will display the "mobile" (hamburger) menu. You/we can't change that.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk