LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code
	
Item 1
Item 2
Item 3
Item 4
Item 5
CSS
@import url(https://fonts.googleapis.com/css?family=Roboto:400,700,500,100&subset=latin,latin-ext);
.mydiv {
  position: relative;
  height: 100vh;
  width: 100%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Roboto', sans-serif;
  font-size: 10vh;
}
.mydiv:nth-child(1) {
  background: #2cc36b;
}
.mydiv:nth-child(2) {
  background: #2980b9;
}
.mydiv:nth-child(3) {
  background: #c0392b;
}
.mydiv:nth-child(4) {
  background: #673AB7;
}
.mydiv:nth-child(5) {
  background: #009688;
}
JS
$(function() {

  var divs = $('.mydiv');
  var div = 0;
  div = -1
  divs.each(function(i) {
    if (div < 0 && ($(this).offset().top >=       $(window).scrollTop())) {
        div = i;
    }
  });
  $(window).on('mousewheel DOMMouseScroll', function(e) {
    if (e.originalEvent.wheelDelta > 0 || e.originalEvent.detail < 0) {
      if (div > 0) {
        div--;
      }
    } else {
      if (div < divs.length) {
        div++;
      }
    }
    $('html,body').stop().animate({
      scrollTop: divs.eq(div).offset().top
    }, 200);
    return false;
  });
  $(window).resize(function() {
    $('html,body').scrollTop(divs.eq(div).offset().top);
  });

});
Host Instantly Drag and Drop Website Builder

 

Description

full page scroll examples
Term
Wed, 11/29/2017 - 11:19

Related Codes

Pen ID
Pen ID
Pen ID