Trying to remove and add classes on window resize... [SOLVED]

Trying to remove and add classes on window resize... [SOLVED]

Hi y'all,
 
I don't know what I'm doing wrong, but I can't seem to get my script to work. Essentially, I'm trying to swap Font Awesome Icon classes if the window size exceeds 767px. But it's just not happening. I have been (and still) going through the forums, both here and on Stack Overflow, and tried suggestions made to other coders... no dice.
 
I certainly hope someone can help me. Many thanks in advance.

Ess'iele
... seeing things.


 
  1. $(function() {
      var wSize = $(window).width();
      $(window).resize(function() {
        if(wSize >= 768) {
          $('#media-icons i')
          .removeClass('fa-2x')
          .addClass('fa-3x');
        } else {
          $('#media-icons i')
          .removeClass('fa-3x')
          .addClass('fa-2x');
        }
      });
    });