This turns any button into one that has to be pressed and held, with a fill sweeping across it while the timer runs. Reach the end and the action fires — delete, cancel, wipe, whatever the button already does. Let go early, slide your finger off, or press Escape and nothing happens at all.
A stray tap can no longer trigger anything, because a quick click is ignored by design. Set how long the hold lasts, from a brief half second to a deliberate three, and style the fill to match your buttons. It works on links, buttons and form submits with one attribute, on desktop and touch, and holding with the keyboard works too.
To get the code, head to: https://www.memberstack.com/scripts/hold-to-confirm-buttons?via=memberscript-on-youtube
Have you used a Memberscript in your project? We'd love to highlight your work and share it with the community💙: https://airtable.com/appcuIe0ED9BSulEJ/
0 Comments