Streaming live at 10am (PST)

onPress instead of onRelease

Maybe I’ll find some folks from the good 'ol Flash era here, when we would sometimes change the onClick/onRelease mouse events for an “onPress” for maximum reactivity.

I’m building a special project here in which I could use, for certain buttons, that onPress event handler.

Would someone be kind enough to help me find a way to implement it simply without exporting/editing the whole code? Like a bit of embed code with a special class or selector I can use and re-use?

Thanks!

Here is a list of GlobalEventHandlers you can work with.

So I guess it’s an “onMouseDown”, thanks! Any idea on how to use it within Webflow? Is there a simple piece of custom code I can use for doing so?

Thanks again,

You have two choices, plain JavaScript or you could use jQuery. jQuery is typically simpler and with webflow, the jQuery library is already loaded on sites.

Take a look at examples on this page.

https://api.jquery.com/mousedown/#mousedown-handler