Reputation: 321
Execute this function below only when the screen resolution is at least 650px wide. Otherwise, do nothing.
$('.section-box').waypoint(function() {
$(this).addClass('animated-107s bounceDown');
}, {
offset: '25%'
});
Could you help me?
Upvotes: 0
Views: 761
Reputation: 2675
You can try it.
<div class=".section-box" id="myClass">
JS
//control first open browser
$(document).ready(function () {
if( $( window ).width() <= 650 ){
$("#myClass").addClass("bounceDown");
}
});
//change browser size
$( window ).resize(function() {
if( $( window ).width() <= 650 ){
$("#myClass").addClass("bounceDown");
} else {
$("#myClass").removeClass("bounceDown");
}
});
Upvotes: 1