0

I'm coding a website essentially for three different breakpoints (desktop, tablet, mobile). I have a javascript plugin running an automatic image change for my full width background. As I resize my window to the tablet and mobile breakpoints, can I disable the javascript plug in and make it stop running when the window is smaller than ***px?

3
  • 2
    No, but you could add a check to the Javascript if screen.width < xxx.... Commented Nov 5, 2013 at 2:31
  • Yes you can "disable" that javascript plugin. But the question is how. And that depends on what the plugin is, how it is coded, etc. Commented Nov 5, 2013 at 2:37
  • Depends entirely on the plugin, if/how it supports being disabled, if it supports automatically disabling itself under certain resolutions, etc... There is no way of answering this in the general case. Commented Nov 5, 2013 at 5:00

1 Answer 1

1
var minWidth = 800 // minimum width of screen
if ($(window).width() <= minSize) {
     // do nothing
}
else {
     // continue script
}

If you wanted it to be width as well as height:

if ($(window).width() <= minWidth && $(window).height() <= minHeight) {

Or something similar.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.