I developed a basic html website with some animations using jquery. However I have to re-design for smaller screen sizes. My current code is:
$(document).ready(function() {
// Animation for Flower Logo
$('.flogo').animate({
width: '350px',
height: '300px'
}, 1000);
});
If I try using jquery for screen sizes the animation stops working. For example:
// Animation for Flower Logo
$(document).ready(function() {
var targetWidth = 768;
if ($(window).width() >= targetWidth) {
$('.flogo').animate({
width: '350px',
height: '300px'
}, 1000);
} else {
$('.flogo').animate({
width: '300px',
height: '300px'
}, 1000);
}
});