Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function ($) {
- $(function () {
- $('.button-collapse').sideNav();
- $('.parallax').parallax();
- $(document).ready(function () {
- $(".dropdown-button").dropdown();
- });
- $('.dropdown-button').dropdown({
- inDuration: 300,
- outDuration: 225,
- constrain_width: false, // Does not change width of dropdown to that of the activator
- hover: true, // Activate on hover
- gutter: 0, // Spacing from edge
- belowOrigin: false, // Displays dropdown below the button
- alignment: 'left' // Displays dropdown with edge aligned to the left of button
- });
- function isElementInViewport(el) {
- var rect = el.getBoundingClientRect();
- return (
- rect.top >= 0 &&
- rect.left >= 0 &&
- rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
- rect.right <= (window.innerWidth || document.documentElement.clientWidth)
- );
- }
- var items = document.querySelectorAll(".timeline li");
- // code for the isElementInViewport function
- function callbackFunc() {
- for (var i = 0; i < items.length; i++) {
- if (isElementInViewport(items[i])) {
- items[i].classList.add("in-view");
- }
- }
- }
- window.addEventListener("load", callbackFunc);
- window.addEventListener("scroll", callbackFunc);
- }); // end of document ready
- })(jQuery); // end of jQuery name space
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement