Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Disabling hover function for ipad/iphone

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #36151

    Hi guys, new here.

    I am designing a welcome page for a client (http://www.tridentcs.tk/) in which I have two hover over images to select from. Now with the iPad and iPhone not supporting this function in the same way, I would like to disable the hover when you visit the site on those devices, and are presented with a static image instead.

    I have found some options using javascript, but for the rollover I am using style=”mouseover” rather than a:hover javascript.

    Anyone have any ideas at all about how I’d achieve this?

    Cheers guys.

    #94801
    jamygolden
    Member

    I think what you want to do is detect for “touch” ability, right? This would get the iPhone, iPad and other touch devices. If so, you could easily do this with modernizr.

    Once modernizr has loaded you can target your site with the touch class added to the <html> element:

    .touch #main { property: value }

    or you could do this via javascript:

    if ( Modernizr.touch ) {
    // Add scripts here
    }
    #94815

    Thanks for that mate I’ll look into it.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Other’ is closed to new topics and replies.