Dogfalo / materialize

Materialize, a CSS Framework based on Material Design
https://materializecss.com
MIT License
38.87k stars 4.74k forks source link

Making an extended floating action button #6641

Open elloworl opened 3 years ago

elloworl commented 3 years ago

Feature Request

Hi! I was wanting to make an extended floating action button that expands/contracts on scroll image Here is my code so far:

var prevScrollpos = window.pageYOffset;
window.onscroll = function() {
  var currentScrollPos = window.pageYOffset;
  if (prevScrollpos > currentScrollPos) {
    document.getElementById("FLOATING_ACTION_BUTTON").style.transform = "scale(1)";
  } else {
    document.getElementById("FLOATING_ACTION_BUTTON").style.transform = "scale(0)";
  }
  prevScrollpos = currentScrollPos;
}

Additional Information

This is automatically mined by FRMiner2.0 from Gitter. ManuTheCoder @ManuTheCoder posted to Room Dogfalo/materialize on Mar 02 18:53 (UTC+8).

elloworl commented 3 years ago

Our work aims to mine useful information from live chats, and let the team be aware of them. Hopefully this can help somehow.