This is evidenced in the rise of design communities, makerspaces and collaborative projects. Over a third of the participants in our recent Audience Survey would rather fulfil a shared goal than achieve a personal one.
This spirit of sharing is also evidenced in people’s work habits. On graduating from university, people we surveyed expected the same easy-going atmosphere in the workplace as they experienced on campus.
// Add an event listener for the scroll event on the window.
window.addEventListener("scroll", () => {
// Get the current scroll position.
let scrollTop = window.scrollY;
// Get the total height of the document.
let docHeight = document.body.offsetHeight;
// Get the height of the window.
let winHeight = window.innerHeight;
// Calculate the percentage of the page that has been scrolled.
let scrollPercent = scrollTop / (docHeight - winHeight);
let scrollPercentRounded = Math.round(scrollPercent * 100);
// Try to open the popup if the visitor has scrolled more than 25% of the page and is not a member.
if (scrollPercentRounded > 25) {
openPopup();
}
});