first let me say that this is my first post so bear with me if I write my question poorly or something ...

But I have this code where I check if a div has a particular class, if it has, it must pick up some items that are styled in a certain way, otherwise get another styling.

My problem is that the if statement only gets checked once, so when I for example start with a window which completely fills the entire screen, and then resize it down to mobile size, it wont check my IF statement agian, and there for do not run it, and it retains the styling from Else statement wich i dont like.

so my question is, is there an opportunity to check on the IF statement is still true when resizing and without using too much bandwith, and checking it constantly ??

```
$.getJSON("GetContent?id=@Model.Id", function (data) {
            var config;
            if ($('html').hasClass('js-mobile')) {
                $('.banner').remove();
                config = HCP.templateConfigurations.mobileConfig();
            } else {
                config = HCP.templateConfigurations.defaultConfig();
            }
            config.data = data;
            createSlider(config);
        });

```