This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).ready(function(){ | |
| $(".topBar__menu a").on('click', function(event) { | |
| if (this.hash !== "") { | |
| event.preventDefault(); | |
| var hash = this.hash; | |
| $('html, body').animate({ | |
| scrollTop: $(hash).offset().top | |
| }, 800, function(){ | |
| window.location.hash = hash; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var scrollPos = 0; | |
| $(window).scroll(function(){ | |
| var st = $(this).scrollTop(); | |
| if (st > scrollPos){ | |
| $('#info').text('DOWN'); | |
| } else { | |
| $('#info').text('UP'); | |
| } | |
| scrollPos = st; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( 'wp_enqueue_scripts', 'my_scripts_method' ); | |
| function my_scripts_method(){ | |
| wp_enqueue_style( 'style', get_stylesheet_uri(), array(), hash_file('crc32', get_stylesheet_uri())); | |
| wp_enqueue_script('libs', get_template_directory_uri() . '/js/libs.js', array(), hash_file('crc32', get_template_directory_uri() . '/js/libs.js'), true); | |
| wp_enqueue_script('custom', get_template_directory_uri() . '/js/common.js', array(), hash_file('crc32', get_template_directory_uri() . '/js/common.js'), true); | |
| wp_deregister_script( 'jquery-core' ); | |
| wp_register_script( 'jquery-core', '//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'); | |
| wp_enqueue_script( 'jquery' ); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $.fn.isOnScreen = function(shift){ | |
| if(!shift){ | |
| shift = 0; | |
| } | |
| var viewport = {}; | |
| viewport.top = $(window).scrollTop(); | |
| viewport.bottom = viewport.top + $(window).height(); | |
| var bounds = {}; | |
| bounds.top = this.offset().top + shift; | |
| bounds.bottom = bounds.top + this.outerHeight() - shift; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var _countDown = function(elem) { | |
| var timerTime = 5000; | |
| var minutes = 15; | |
| var counter = $('.counter__num'); | |
| var value = counter.text(); | |
| var date = new Date(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| border: 0 transparent solid | |
| background-clip: padding-box | |
| border-left-width: 7px |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { | |
| /* IE10+ CSS */ | |
| } | |
| @supports (-ms-ime-align:auto) { | |
| /* IE Edge 12+ CSS */ | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var flag = true; | |
| $(window).mouseout(function(e) { | |
| if (e.pageY - $(window).scrollTop() < 1 && flag == true) { | |
| doSomething(); | |
| flag = false; | |
| } | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var parallax = function() { | |
| $(window).on('scroll', function() { | |
| var st = $(window).scrollTop(); | |
| $('.js-parallax-container').each(function() { | |
| var containerOffset = $(this).offset(), | |
| containerOffsetTop = containerOffset.top, | |
| containerHeight = $(this).outerHeight(); | |
| scrollTop = (st - containerOffsetTop) + (containerHeight/4); // ставим точку отсчета паралакса от середины контейнера | |
| $('.js-parallax', this).each(function() { | |
| var speed = 10, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $.fn.isOnScreen = function(shift) { | |
| if (!shift) { | |
| shift = 0; | |
| } | |
| var viewport = {}; | |
| viewport.top = $(window).scrollTop(); | |
| viewport.bottom = viewport.top + $(window).height(); | |
| var bounds = {}; | |
| bounds.top = this.offset().top + shift; | |
| bounds.bottom = bounds.top + this.outerHeight() - shift; |