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

  • SEARCH
  • Home
  • 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 8385337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:38:41+00:00 2026-06-09T17:38:41+00:00

I am building a responsive site, and as such require different functionality depending on

  • 0

I am building a responsive site, and as such require different functionality depending on the size of the window.

So if the screen is less than 964px wide, I want to disable my jquery call. If it’s more than 964px, I want to enable that same call.

This is what I got:
http://jsfiddle.net/frogfacehead/2Mdem/1/

Problem is, the disable part doesn’t work. Once it’s been enabled, it doesn’t disable even when the screen falls below 964px.

Any ideas?

  • 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-09T17:38:42+00:00Added an answer on June 9, 2026 at 5:38 pm

    Rather than using all those resources to attach the hover function to that element as the size of the page changes, why not check the size of the page during those callback functions?

    $(".test").hover(function() {
                if (width > 964) {
                    $(this).animate({
                        width: "100px"
                    })
                }
            }, etc.
    

    The problem is that you add a function to handle the hover event, but that function never gets removed. You are repeatedly adding it, as the width of the page changes. Just add it once, and then do your checks for what should happen within the handler of that function. As a bonus to working correctly, it should be a bit more efficient.

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

Sidebar

Related Questions

I'm starting off building a site which should be responsive to different screen sizes.
I'm building a responsive site, and on one particular page, I'm trying to have
I am building a sharepoint site to track project progress. Different teams are responsible
I'm building a responsive site using WordPress, and images are automatically set to height:100%;
I'm in the process of building a responsive calendar for a site I'm working
building a site using PHP and MySQL that needs to store a lot of
I'm building an ASP.NET MVC site where I want to decorate my ViewModels with
I'm building a site on Spree 0.70.3 and Rails 3.1.3. In development I just
I am building a site with JSPs and Servlets. How do I map a
I'm test building a scraping site with django. For some reason the following code

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.