Hacker News new | past | comments | ask | show | jobs | submit login

Especially considering that you can't hover in mobile phones or tablets.



Well, mainly because you can only "touch/click". You can replicate a hover though, saying the hover goes on when you touch, and goes off when you release.

For example:

if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i)) || (navigator.userAgent.match(/Android/i))) {

    $("a").bind('touchstart', function(){

        $(this).addClass('hover');

    });

    $("a").bind('touchend', function(){

        $(this).removeClass('hover');

    });
}

This should work in theory.


Which is what I thought this article would be about based on the title.


I was hoping it would be about the touchscreen issue. I think it's something that needs more exposure.


Yeah, that's a pretty nasty problem actually.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: