LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code

Responsive/destructive images

Requirements - jQuery 1.8+

CSS
body {
  background: #efefef;
}

h1 {
  text-align: center;
  margin: 2em 0 1em;
}

p {
  text-align: center;
}

img {
  width: 100%;
  height: auto;
}

.show-for-mobile {
  display: none !important;
}

.hide-for-mobile {
  display: block !important;
}

@media screen and (max-width: 768px) {
  .show-for-mobile {
    display: block !important;
  }

  .hide-for-mobile {
    display: none !important;
  }
}
JS
var Window = $(window),
    Wrapper = $('#wrapper'),

    // Only load images for large screens
    respImgs = function(wWidth){
        var images = Wrapper.find('.resp-image'),
            numImgs = images.length,
            x;

        if (wWidth > 767){
            for (x=0;x

Description

For preventing loading of images on mobile to save bandwidth over 3G/4G
Term
Sat, 01/13/2018 - 08:31

Related Codes

Pen ID
Pen ID
Pen ID
Square Adv