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.
我想将用户操作系统的“等待光标”显示为我网页的静态元素。例如,对于 Windows 7,我想将此动画放在页面上的特定位置:
有没有办法根据用户的操作系统来选择动画,而不是像上面那样为所有操作系统使用单个 GIF?
注意:我不想更改用户的实际光标。
您可以使用 Navigator 对象
if(navigator.platform == "Win32"){ //for windows ///Codez }
platform 是具有以下值之一的字符串:“Win32”、“Linux i686”、“MacPPC”、“MacIntel”或其他。
MDN