I'm working on jsfiddle but the javascript file doesn't seem to be added to my the html. I'm trying to remove a class from a div on my footer when the screen reaches a certain width. I'm using bootstrap and I have the following footer:
HTML
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<body>
<footer>
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<h2><b>Heading1</b></h2>
<p><small>aaaaaaaaaaaaaaaaaaaaaaa</small></p>
<p><small>aaaaaaaaaaaaaaaaaaaaaaa</small></p>
<p><small>aaaaaaaaaaaaaaaaaaaaaaa</small></p>
</div>
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<div class="text-right" id="footer-right">
<h2><b>Heading2</b></h2>
<p><small>aaaaaaaaaaaaaaaaaaaaaaa</small></p>
<p><small>aaaaaaaaaaaaaaaaaaaaaaa</small></p>
<p><small>aaaaaaaaaaaaaaaaaaaaaaa</small></p>
</div>
</div>
</div>
</div>
</footer>
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
</body>
Now, I want to remove the "text-right" class when the screen is 500px wide:
JAVASCRIPT
var readaptClasses = function(){
var width = $(window).width();
alert(width);
if (width < 500){
$("#footer-right").removeClass("text-right"):
}
else {
$("#footer-right").addClass("text-right"):
}
};
$(document).ready(readaptClasses);
$(window).on('resize', readaptClasses);
Nothing happens...