{"id":1318,"date":"2015-01-20T18:32:17","date_gmt":"2015-01-20T18:32:17","guid":{"rendered":"http:\/\/freshinbox.com\/blog\/?p=1318"},"modified":"2016-08-17T21:48:44","modified_gmt":"2016-08-17T21:48:44","slug":"hamburger-collapsible-menu-in-email","status":"publish","type":"post","link":"https:\/\/freshinbox.com\/blog\/hamburger-collapsible-menu-in-email\/","title":{"rendered":"&#8216;Hamburger&#8217; Collapsible Menu in Email"},"content":{"rendered":"<p>The <a href=\"http:\/\/blog.placeit.net\/history-of-the-hamburger-icon\/\" title=\"History of the Hamburger\" target=\"_blank\">hamburger collapsible menu<\/a> is pretty ubiquitous on mobile responsive websites these days. The hamburger menu allows navigation menus to be hidden when viewed on mobile devices. The menus are displayed when the user taps on an icon that consists of three fat horizontal lines that somewhat resembles a hamburger.<\/p>\n<p><a href=\"http:\/\/www.jmweb.net\/\" title=\"JM Web Services\" target=\"_blank\">Jerry Martinez<\/a> posted on the <a href=\"https:\/\/litmus.com\/community\/discussions\/999-hamburger-in-email\" target=\"_blank\">Litmus Community forum<\/a> that he had implemented a version of the hamburger menu in emails. I thought it was so awesome that I just had to share it!<BR><BR><\/p>\n<p><a href=\"https:\/\/freshinbox.com\/blog\/wp-content\/uploads\/2015\/01\/hamburger-animated.gif\"><img decoding=\"async\" src=\"https:\/\/freshinbox.com\/blog\/wp-content\/uploads\/2015\/01\/hamburger-animated.gif\" alt=\"hamburger-animated\" width=\"400\" class=\"aligncenter size-full wp-image-1347\" \/><\/a><br \/>\nView Jerry\u2019s <a href=\"http:\/\/www.jmweb.net\/code\/hamburger-in-email\/\" target=\"_blank\">example code<\/a>.<BR><BR><\/p>\n<h4>Using the Checkbox Technique<\/h4>\n<p>The hamburger button is wrapped with a label that targets a hidden checkbox using the &#8220;for&#8221; attribute.  When the checkbox is toggled, the menu is displayed and hidden using the CSS3 :checked pseudo-class.<\/p>\n<p>A simplified version looks like this:<\/p>\n<pre class=\"lang:default decode:true \" >&lt;style&gt;\r\n#hidden-checkbox:checked + div #menu{\r\n  ... css to display menu ...\r\n}\r\n&lt;\/style&gt;\r\n&lt;input id=\"hidden-checkbox\" type=\"checkbox\"&gt;\r\n&lt;div&gt;\r\n  &lt;label for=\"hidden-checkbox\"&gt;Hamburger Button&lt;\/label&gt;\r\n  &lt;div id=\"menu\"&gt;Menu Content...&lt;\/div&gt;\r\n&lt;\/div&gt;<\/pre>\n<p>The checkbox technique is becoming increasingly popular with interactive email designs and you can see them used on this <a href=\"https:\/\/freshinbox.com\/blog\/interactive-tabs-for-email\/\" title=\"Tabs for Email\">tabs for email example<\/a>, this <a href=\"https:\/\/litmus.com\/builder\/d965a91\" target=\"_blank\">Litmus email<\/a> and this <a href=\"http:\/\/emailcodegeek.com\/thwack-a-vole\/\" target=\"_blank\">email game<\/a>.<\/p>\n<p>Here&#8217;s a technique to <a href=\"https:\/\/freshinbox.com\/blog\/how-to-hide-checkbox-and-radio-in-email\/\">hide checkboxes<\/a> from all the email clients.<BR><BR><\/p>\n<h4>Interesting Tricks<\/h4>\n<p>A few things I noticed about the example:<\/p>\n<ul>\n<li>The hamburger button was built completely in CSS! This removes any image dependency for this to work.<BR><BR><\/li>\n<li>The menu items are wrapped in their own table and are set to 100% width in mobile, allowing the menus to appear vertical.<BR><BR><\/li>\n<li>Conditional comments were used to wrap the responsive menu tables within table cells in Outlook 2007+.  I\u2019m interested in testing this out to see what effects this had on the design.<BR><BR><\/li>\n<li>CSS transitions to hide and show the menu made it look polished.<\/li>\n<\/ul>\n<p><BR><\/p>\n<div style=\"max-width:400px;margin:20px auto;padding:20px;border:2px solid #AC88AC;text-align:center;border-radius:3px;\">\nCheck out the <a href=\"https:\/\/freshinbox.com\/blog\/hybrid-collapsible-menu-for-email\/\">hybrid hamburger menu example<\/a>  that uses :hover when checkboxes are not supported (ie. with MailChimp).\n<\/div>\n<p><BR><\/p>\n<h4>Discussion<\/h4>\n<p>I thought this is one of the best applications of an interactive email technique as the hamburger menu concept is not only simple but also very useful.<\/p>\n<p>If you think this is cool and would like the join the discussion,  head over to the <a href=\"https:\/\/litmus.com\/community\/discussions\/999-hamburger-in-email\" target=\"_blank\">Litmus community forum<\/a>!<\/p>\n<p><BR><BR><br \/>\n<div style=\"padding:10px; border: 2px solid #99C731;background-color:#FFF8DC;border-radius:5px;\">\n<form action=\"https:\/\/freshinbox1.createsend.com\/t\/i\/s\/adrmi\/\" method=\"post\" id=\"subForm\">\n<span class=\"fisub_header\" style=\"font-weight:bold;\">Subscribe to the #EmailGeeks Newsletter<\/span>\n<p><input id=\"fieldEmail\" name=\"cm-adrmi-adrmi\" type=\"email\" style=\"width:90%\" required placeholder=\"Your Email Address\" \/><\/p>\n<p><button type=\"submit\">Subscribe<\/button><\/p>\n<\/form>\n<\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Jerry Martinez posted on the Litmus Community forum that he had implemented a version of the hamburger menu in emails. I thought it was so awesome that I just had to share it!<\/p>\n","protected":false},"author":2,"featured_media":1358,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[24,25],"tags":[],"_links":{"self":[{"href":"https:\/\/freshinbox.com\/blog\/wp-json\/wp\/v2\/posts\/1318"}],"collection":[{"href":"https:\/\/freshinbox.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/freshinbox.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/freshinbox.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/freshinbox.com\/blog\/wp-json\/wp\/v2\/comments?post=1318"}],"version-history":[{"count":58,"href":"https:\/\/freshinbox.com\/blog\/wp-json\/wp\/v2\/posts\/1318\/revisions"}],"predecessor-version":[{"id":1367,"href":"https:\/\/freshinbox.com\/blog\/wp-json\/wp\/v2\/posts\/1318\/revisions\/1367"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/freshinbox.com\/blog\/wp-json\/wp\/v2\/media\/1358"}],"wp:attachment":[{"href":"https:\/\/freshinbox.com\/blog\/wp-json\/wp\/v2\/media?parent=1318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/freshinbox.com\/blog\/wp-json\/wp\/v2\/categories?post=1318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/freshinbox.com\/blog\/wp-json\/wp\/v2\/tags?post=1318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}