Skip to content

Instantly share code, notes, and snippets.

View Korveld's full-sized avatar
🏠
Working from home

Kirill Korveld

🏠
Working from home
  • Ukraine
View GitHub Profile
@Korveld
Korveld / scroll2object.js
Last active January 19, 2016 11:26
Scroll2object
// Scroll to object
$("#arrow-down").on('click', function(e) {
$('html, body').animate({
scrollTop: $("#descr-section").offset().top
}, 1000);
e.preventDefault();
});
@Korveld
Korveld / scroll-to-top.js
Created May 22, 2015 11:58
Scroll to top of the page
$(window).scroll(function () {
if ($(this).scrollTop() > 150) {
$('.scroll-top').fadeIn(400);
}
else {
$('.scroll-top').fadeOut(400);
}
});
$('.scroll-top').click(function () {
$('body, html').animate({
@Korveld
Korveld / change-window-nav.js
Created May 22, 2015 11:59
Navigation change window size function
function changeWindow() {
var $browserWidth = window.innerWidth || document.documentElement.clientWidth;
if ($browserWidth > 980) {
$('nav .right > ul').show();
$('nav .right li.menu-item-has-children').on({
mouseover: function () {
@Korveld
Korveld / sticky-head.js
Last active January 19, 2016 14:47
Sticky header
// Sticky header
$(window).scroll(function() {
if ( $(this).scrollTop() > 0 ) {
$('.top-block').addClass('fixed');
} else if( $(this).scrollTop() == 0 ) {
$('.top-block').removeClass('fixed');
}
});
@Korveld
Korveld / lightbox.js
Created May 22, 2015 12:03
Lightbox js file
var $overlay = $('.overlay');
var $lightbox = $('.lightbox');
$('#elementId').click(function(event) {
$overlay.fadeIn(300);
$lightbox.fadeIn(300);
event.preventDefault();
});
@Korveld
Korveld / lightbox.sass
Created May 22, 2015 12:04
Lightbox sass file
.overlay
background: none repeat scroll 0 0 rgba(0, 0, 0, 0.7)
display: none
height: 100%
left: 0
position: fixed
text-align: center
top: 0
width: 100%
z-index: 10000
@Korveld
Korveld / preloader.js
Created May 22, 2015 12:05
Preloader js file
$(window).on('load', function() {
$(".loader_inner").fadeOut(300);
$(".loader").fadeOut(300);
});
@Korveld
Korveld / preloader.sass
Created May 22, 2015 12:05
Preloader sass file
.loader
background: none repeat scroll 0 0 #ffffff
bottom: 0
height: 100%
left: 0
position: fixed
right: 0
top: 0
width: 100%
z-index: 9999
@Korveld
Korveld / sandwich.html
Created May 22, 2015 12:08
Sandwich html
<button class="toggle-mnu">
<span class="sandwich">
<span class="sw-topper"></span>
<span class="sw-bottom"></span>
<span class="sw-footer"></span>
</span>
</button>
@Korveld
Korveld / sandwich.sass
Last active August 29, 2015 14:21
Sandwich sass
.toggle-mnu
width: 60px
height: 50px
position: absolute
z-index: 100
border: none
right: 20px
top: 9px
background-color: #1b1464
display: none