<body>
<div id="wrapper">
<section><!--your content--></section>
<!--other sections-->
<section><!--your content--></section>
</div>
</body>
<script src="path/to/wall.min.js"></script>
<script>
var wall = new Wall('#wrapper');
</script>
Note: wall.js will not create them directly, what wall.js does is to toggle the active class
< !-- DON'T ADD THE NAV ELEMENT INSIDE THE WRAPPER -- >
<ul class="nav" data-wall-section-nav>
<li>First</li>
<li>Second</li>
</ul>
<div id="wall"> <!-- wrapper -->
<section>First Section</section>
<section>Second Section</section>
</div>
<ul class="dot" data-wall-section-nav>
<li></li>
<li></li>
</ul>
here is an example of dot nav
.dot {
position: absolute;
top: 50%;
right: 50px;
transform: translateY(-50%);
}
.dot>li {
width: 16px;
height: 16px;
margin-bottom: 10px;
border: 2px solid #fff;
border-radius: 50%;
background-color: transparent;
box-sizing: border-box;
list-style: none;
cursor: pointer;
}
.dot>li.active,
.dot>li:hover {
background-color: #fff;
}
wall.js will add 'active' class to the nav item when you move into new section.
You can set your own active class with config object when you init Wall.
var config = {
sectionNavItemActiveClass: 'my-active-class'
}
var wall = new Wall('#wall',config);
var config = {
sectionAnimateDuration: 3 // every section now move 3 seconds
}
var wall = new Wall('#wall', config);
This Section will take 3 seconds of animation.
<div id="wall">
<section class="section-1"></section>
<section class="section-2"></section>
<section class="section-3"></section>
<section class="section-4" data-wall-animate-duration=3></section>
<section class="section-5"></section>
<section class="section-6"></section>
</div>
<div id="wall">
<section>
<!--other sections-->
<div data-wall-slide><!--slide content--></div>
<div data-wall-slide data-wall-animate-duration=3><!--slide content--></div> <!--this section move 3 seconds-->
<div data-wall-slide><!--slide content--></div>
<!--other sections-->
</section>
</div>
Open your develop tool to check it!
<section class="section-1"><!--content--></section>
<section class="section-2"><!--content--></section>
<section class="section-3"><!--content--></section>
<section class="section-4"><!--content--></section>
<section class="section-5 current"><!--content--></section><!--current section-->
Open your develop tool to check it!
<section class="section-1"><!--content--></section>
<section class="section-2"><!--content--></section>
<section class="section-3"><!--content--></section>
<section class="section-4"><!--content--></section>
<section class="section-5 animating current"><!--content--></section><!--if you animate this section-->
h1 {
opacity: 0;
transition: opacity .3s ease;
}
.current h1 {
opacity: 1;
}
Bring it into full play!
var wall = new Wall('#wall');
wall.prevSection(); // go to prev section;
wall.nextSection(); // go to next section;
wall.goToSection(1); // go to paticular section, param type is number
wall.prevSlide(); // go to prev slide if slides exists in current section
wall.nextSlide(); // go to next slide if slides exists in current section
const defaultOptions = {
// control the wrapper z-index style,
//other element you want to show should above greater than this
wrapperZIndex: 1,
// global animation duration,
// change it will change all section animate duration
sectionAnimateDuration: 1,
// take both string and function,
// the string show be inside 'linear', 'easeIn', 'easeOut', 'easeInOut'
easeFunction: 'easeIn',
// whether loop to bottom in first section
loopToBottom: false,
// whether loop to top in last section
loopToTop: false,
sectionNavItemActiveClass: 'active',
// set current section class name
animatingClass: 'animating',
currentClass: 'current'
};