Reputation: 619
I am trying to write a JQuery function, so when I resize a window at 700px, I can remove a CSS class.
Is there any way I could do that?
Could someone point me to some resources or give me and example?
Upvotes: 0
Views: 74
Reputation: 2290
Using two sets of CSS and use media query to listen to screen width might be easier and better. And gives you more control of style on smaller browser sizes and better result.
Upvotes: 0
Reputation: 44813
1) Listen for resize event see http://api.jquery.com/resize/
E.g
$( window ).resize(function() {
$( "body" ).prepend( "<div>" + $( window ).width() + "</div>" );
});
2) Remove class see http://api.jquery.com/removeClass/
E.g
$( "p" ).removeClass( "myClass yourClass" )
Upvotes: 1