Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您可以将滑动事件重新附加到新元素,因为当您添加初始事件时它们不存在。
试试这个小提琴。
我添加了一个 addSwipeTo带有选择器的函数,并将事件添加到它匹配的元素中。
addSwipeTo