Skip to content

Instantly share code, notes, and snippets.

$(function (){
$("#scrollup").hide();
$(window).scroll(function (){
if ($(this).scrollTop() > 700){
$("#scrollup").fadeIn(500);
} else{
$("#scrollup").fadeOut(500);
}
});
$(document).ready(function() {
var scrollTop = 0;
$(window).on('scroll', function() {
var scrollNow = $(window).scrollTop();
if(scrollNow > scrollTop && scrollNow > 20){
$('.header').addClass('setout');
} else {
$('.header').removeClass('setout');
Preferences -> Package Settings -> LiveReload -> Settings User
{
"enabled_plugins": [
"SimpleReloadPlugin",
"SimpleRefresh"
]
}
http://livereload.com/extensions/
<script>
$('.fotorama')
.on('fotorama:fullscreenenter fotorama:fullscreenexit', function (e, fotorama) {
if (e.type === 'fotorama:fullscreenenter') {
// Options for the fullscreen
fotorama.setOptions({
fit: 'cover'
});
} else {
@VasylKyryliuk
VasylKyryliuk / плавний скролл по якорям
Created February 20, 2017 15:00
плавний скролл по якорям
$('a[href^="#"]').click(function(){
//Сохраняем значение атрибута href в переменной:
var target = $(this).attr('href');
$('html, body').animate({scrollTop: $(target).offset().top}, 800);
return false;
});
@VasylKyryliuk
VasylKyryliuk / Скролл горизонтального меню
Created February 20, 2017 15:02
Скролл горизонтального меню
<div class="nav">
<nav class="cvu-navigation">
<ul class="navigation">
<li class="active"><a href="#">Послуги</a></li>
<li><a href="#">Акції</a></li>
<li><a href="#">Галерея</a></li>
<li><a href="#">Жалюзі та ролети</a></li>
<li><a href="#">Натяжні стелі</a></li>
<li><a href="#">Ковані вироби</a></li>
<li><a href="#">Статті</a></li>
if ($_SERVER['REMOTE_ADDR'] == '91.199.194.247') {
тут писати
}
@VasylKyryliuk
VasylKyryliuk / Появление фиксированного меню после ..px
Created May 16, 2017 14:59
Появление фиксированного меню после ..px
function fixedHeader() {
var
boss = $(window),
y = boss.scrollTop();
if (y > (218)) {
$('.header-fixed-wrapper').fadeIn(200);
} else {
$('.header-fixed-wrapper').fadeOut(100);
}
}
@VasylKyryliuk
VasylKyryliuk / Дія при кліку по любому місці
Created September 1, 2017 15:51
Дія при кліку по любому місці
$(document).click(function(e){
if ($(e.target).closest("#header-search #search_mini_form").length) return;
$('#header-search #search_mini_form').removeClass('active');
e.stopPropagation();
});
АБО
@VasylKyryliuk
VasylKyryliuk / Custom play button YouTube
Created October 26, 2017 09:58
Custom play button YouTube
--------------------- HTML ---------------------
<div class="youtube" id="lR4tJr7sMPM"
data-params="modestbranding=1&showinfo=0&controls=0&vq=hd720"
style="width:640px;height:360px;"></div>
--------------------- JS ---------------------
"use strict";