简体   繁体   中英

Forwarding a touchmove event

I have an element that sits on top of a horizontally scrollable element. When I scroll over this element I want to forward that scroll event to the scrollable element below, but when I click on it I want it to do something else.

$(".scroll-indicator").on("touchmove", function(evt){
    // forward scroll event to ".scrollable-element"
});

$(".scroll-indicator").on("click", function(evt){
    alert("Clicked!");
});

How can I forward the scroll event to my scrollable element?

使用jquery 触发函数可手动在特定元素上触发事件。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM