Background
The perfect picture news rotation effect I want:
1. There are news pictures, news titles, and a rotation index
2. The pictures automatically switch when the mouse is not moved to the index
3 .Move the mouse over the index, display the existing pictures, and the polling will stop
4. Move the mouse away from the index, and the polling will continue
5. Simple, clear, and lightweight (does not rely on any third-party files, preferably Native js)
Process
I have found many image polling effects, but they are always somewhat different from my requirements and cannot be perfect. Either it's not functional, it's just too fancy. I wanted to develop one myself, but due to delays in trivial matters, I have been unable to start.
Occasionally I see picture news from Tencent Dayue.com, which feels like the effect I want. However, after careful testing, it was found that it did not meet requirement 3. That is, there is no polling stopping mechanism. Thinking about it, I might as well modify it myself, and it will be almost in line with my requirements.
Idea: The page loads and pictures start polling. Move the mouse to the index to display related pictures and clear polling. Move the mouse away from the index to resume polling.
Define a global variable id to record the currently activated image index id. Each time it is rotated, this id is updated. After the mouse moves away from the index, start polling with this id.