How to use .resize()?

Hi all.
Use the script the rest of the time .timeTo(). Font size 55px. I need when the screen width 500px font was 35px.

$(window).resize(function() {
 if ( $(window).width() >= "500" ) {
desk();
 } else {
mobile();
}
});


 function desk() {
console.log('1');
 $('#timeTwo, #timeOne').timeTo({
 timeTo: new Date(new Date('Sat, 31 Dec 2017 00:00:01 GMT+0200 (Finland (winter))')),
 displayDays: 0,
 lang: 'EN',
 displayCaptions: true,
 fontSize: 55,
 captionSize: 16
});
}

 function mobile() {
 $('#timeTwo, #timeOne').timeTo({
 timeTo: new Date(new Date('Sat, 31 Dec 2017 00:00:01 GMT+0200 (Finland (winter))')),
 displayDays: 0,
 lang: 'EN',
 displayCaptions: true,
 fontSize: 35,
 captionSize: 16
});
 }


When you open the website time is not visible at all when screen change time there, but .resize() does not work. What am I doing wrong? If you know how to shorten the code, I'd appreciate it.
June 10th 19 at 15:23
1 answer
June 10th 19 at 15:25
Solution
resize() works.
You are trying to initialize a plugin that already works, that's the problem.
Built-in method destroy have not found it, is to delete it and create a new one.

Or using css zoom to shrink and all)
Thank you. - lily.Abshire82 commented on June 10th 19 at 15:28

Find more questions by tags jQuery