Function freya_elements::elements::events::onwheel

source ·
pub fn onwheel<E: EventReturn<T>, T>(
    _f: impl FnMut(Event<WheelData>) -> E + 'static,
) -> Attribute
Expand description

The wheel event fires when the user scrolls the mouse wheel while hovering over the element.

Event Data: TouchData

§Example

fn app() -> Element {
    rsx!(
        rect {
            width: "100",
            height: "100",
            background: "red",
            onwheel: |_| println!("Scrolling with the wheel!")
        }
    )
}