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 8737579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:33:25+00:00 2026-06-13T10:33:25+00:00

I am making a login page in which I use a little javascript and

  • 0

I am making a login page in which I use a little javascript and jquery to vertically align the login box.

I also have an event on resize() to put the box in the middle again.

But, with resize(), everytime the user resize the window, the function is fired and this is a kind of ugly :))

So, I would like to know if there is a way to fire the function only on vertical resize.

Thank you

  • 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-13T10:33:26+00:00Added an answer on June 13, 2026 at 10:33 am

    It will fire every time, but you can track the width to check for only vertical resizing:

    // track width, set to window width
    var width = $(window).width(); 
    // fire on window resize
    $(window).resize(function() {
        // do nothing if the width is the same
        if ($(window).width()==width) return; 
        // update new width value
        width = $(window).width();
        // ... your code
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making a project in which i have a login page. i am
I am Making an Iphone application which is web-service enabled. Also I have skeleton
I'm making a web application in which certain pages are login-protected. I have created
I am making a simple web-app which requires login for the admin page. I
So I am making a basic log-in page. I have a good idea of
I have a page which has three components: suggested items, suggested people, and a
I making a php server/page which is supposed to capture a users twitter feed
We have some code that is making use of the new postMessage functionality in
Hey Frens I am making one project in asp.net C#, in which i have
I have a simple Rails application with which I am trying to use the

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.