Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8798529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:07:07+00:00 2026-06-14T00:07:07+00:00

I am trying to tackle mobile and desktop with this function. Is there a

  • 0

I am trying to tackle mobile and desktop with this function. Is there a way to take this script I’m using for hover and add an or operator for Modernizr to see if it detects the touch functionality, and if not, use hover? Hoping someone can help clarify this for me.

$(function() {
        $('ul.recent-widget li').hover(function(){
            $(this).find('img').animate({top:'182px'},{duration:500});
        }, function(){
            $(this).find('img').animate({top:'0px'},{duration:500});
        });
    });

Here’s an example of if working for the desktop http://jsfiddle.net/chris_s/dcq2F

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:07:10+00:00Added an answer on June 14, 2026 at 12:07 am

    Using Modernizr, you certainly could set up a conditional, as you infer in the comments above, which would only run one function or the other:

    if ( Modernizr.touch ) {
       // click or bind to touchstart, touchmove, etc
    } else {
       // hover (like your animation example)
    }
    

    Regarding performance, you might also consider using a default css transition or animation, then leverage !Modernizr.csstransitions, on that hover function, for example.

    Of course, with mobile being such a moving target, there are caveats with any one solution. Perhaps combo test on several criteria (screen size, feature detection, polyfills, etc.) and go with what works best for your situation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was wondering about the best way to tackle this. I'm trying to save
I'm trying to figure out what the best way to tackle this would be.
Hi there guys trying to gather some ideas to tackle this problem. i am
I have this problem I've been trying to tackle for a while. I have
I've been trying to tackle this for hours. Ive even looked at other similar
I am trying to tackle the Nbody example in my java class (this is
I am trying to figure out how to tackle this problem. I have to
I am trying to determine how I want to tackle this... this is all
I am trying to tackle a program take the given input file is in.properties
I've been trying to tackle this crash and just don't know where to begin.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.