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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:47:34+00:00 2026-06-14T20:47:34+00:00

I was wondering how i would go about selecting this class and changing it

  • 0

I was wondering how i would go about selecting this class and changing it to a span12 once the screen size is below 1000px using jquery

<div class="span4 minus65">

I am using

$(window).resize(function(){
    if($(this).outerWidth() < 1000){
        $('.span4 minus65').attr('class',"span12");
    }

});

but nothing changes when the screen width is below 1000px

  • 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-14T20:47:35+00:00Added an answer on June 14, 2026 at 8:47 pm

    If you can’t use media queries, you should use “addClass” and “removeClass”

    $(el).addClass('span12').removeClass('span4');
    

    Depending on the browser, “resize” sometimes will fire, and sometimes will fire too often. You should take the function you’re using in the “resize” event and fire it periodically like so:

    var resizeFunc = function(){
        //add/remove classes
    };
    
    //"fix" the sizing even if "resize" doesn't fire.
    setInterval(resizeFunc(), 1000);
    
    jQuery(document).resize(resizeFunc);
    

    Also, resize will fire…A LOT. You can also “throttle” it so that it doesn’t fire more than once every few hundred milliseconds.

    You should probably consider using media queries for this (which has good support in newer versions of IE and all the other modern browsers:

    http://caniuse.com/#search=media%20queries

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

Sidebar

Related Questions

Just wondering how people would go about this. Say I have one class that
I was wondering how I would go about mapping 2D screen coordinates to a
I was wondering how would go about displaying five images in a row using
I was wondering what you would think about using jsperf.com Chrome test results as
I was wondering how i would go about changing image.src in the javascript without
I am wondering how I would go about externalizing a proc (example below) so
I was wondering how I would go about using Python to create a Graph
I was wondering how would I go about using mysqldump to backup my database
I am wondering how I would go about storing this in MySQL I am
I was wondering how I would go about accessing one instance of a class,

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.