S
S
Sergey Goryachev2015-11-01 12:20:08
css
Sergey Goryachev, 2015-11-01 12:20:08

Responsive website, how to make the script execute at different screen resolutions?

There is an adaptive site, how to make the script execute depending on the screen resolution.

jQuery('.block').addClass("hidden").viewportChecker({
    classToAdd: 'visible animated fadeIn', offset: 50
  });

How to write the correct condition? Something didn't quite work out for me.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Goryachev, 2015-11-01
@webirus

I decided.

jQuery(document).ready(function(){
  var w = screen.width;
  if (w >= '1000') {
    // выполняем на экранах больше 1000рх
  } else {
    if (w >= '600') {
      // выполняем на экранах больше 600рх
    } else {
      if (w < '600') {
        // выполняем на экранах меньше 1000рх
      }
    }
  }
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question