How do I simulate a hover with a touch in touch enabled browsers?

后端 未结 14 2088
旧巷少年郎
旧巷少年郎 2020-11-22 17:04

With some HTML like this:

Some Text

Then some CSS like this:

p {
  color:black;
}

p:hover {
  color:red         


        
14条回答
  •  礼貌的吻别
    2020-11-22 17:27

    Without device (or rather browser) specific JS I'm pretty sure you're out of luck.

    Edit: thought you wanted to avoid that until i reread your question. In case of Mobile Safari you can register to get all touch events similar to what you can do with native UIView-s. Can't find the documentation right now, will try to though.

提交回复
热议问题