material-design-lite

How to hide drawer upon user click

送分小仙女□ 提交于 2019-11-27 17:36:25
问题 How do I hide the drawer when the user clicks on an item? Or when a button is clicked? <div class="mdl-layout__drawer"> <span class="mdl-layout-title">Title</span> <button class="mdl-button mdl-js-button mdl-button--fab mdl-button--mini-fab mdl-js-ripple-effect" id="clickme"> <i class="material-icons">add</i> </button> </div> How do I do it that when the button is clicked, the drawer will be hidden as if I clicked outside of the drawer? I tried simulating a click event outside of the drawer

Material Design Lite and jQuery, smooth scroll not working

笑着哭i 提交于 2019-11-27 16:57:20
问题 I am unable to use .animate method of jQuery with Google's Material Design Lite(MDL). I have used MDL to make navigation bar, but smooth scrolling was not working. Simple jQuery code is this: $(function(){ $('a.smooth').click(function(){ console.log("SMOOTH BEGIN"); var speed = 1000; var href= $(this).attr("href"); var target = $(href == "#" || href == "" ? 'html' : href); var position = target.offset().top; $("html, body").animate({scrollTop:position}, speed, "swing"); console.log("SMOOTH