Skip to content

Instantly share code, notes, and snippets.

View upiter-2005's full-sized avatar
🏠
Working from home

Pavel Kuchenev upiter-2005

🏠
Working from home
  • Ukraine
View GitHub Profile
@upiter-2005
upiter-2005 / button.sass
Created July 4, 2017 09:40 — forked from agragregra/button.sass
Button Sass Styles (Universal Starter)
.button
display: inline-block
border: none
color: #fff
text-decoration: none
background-color: $accent
padding: 15px 45px
font-size: 13px
text-transform: uppercase
font-weight: 600
@upiter-2005
upiter-2005 / for_owl.sass
Created July 4, 2017 20:28
Sass Цикл для карусели
$colors: $blue, $red, $accent
@for $i from 1 through length($colors)
.carousel-services .owl-item:nth-child(#{length($colors)}n+#{$i})
background-color: nth($colors, $i)
function heightDetect(){
$(".main-head").css("height", $(window).height());
}
heightDetect();
$(window).resize(function(){
heightDetect();
});
@upiter-2005
upiter-2005 / Ajax send form new
Created September 13, 2017 10:15
Ajax send form new
$("#formAjax").submit(function() {
var data = $(this).serialize();
$.ajax({
type: "POST",
url: "mail.php",
data: data
}).done(function() {
$(this).find("input").val("");
alert("Спасибо за заявку! Скоро мы с вами свяжемся.");
@upiter-2005
upiter-2005 / sticky.js
Created November 23, 2017 20:08
sticky js script
$(window).scroll(function() {
if ($(this).scrollTop() > 1){
$('header').addClass("sticky");
}
else{
$('header').removeClass("sticky");
}
});
.video
position: relative
padding-bottom: 56.25%
padding-top: 25px
height: 0
iframe
border: none
position: absolute
top: 0
left: 0
@upiter-2005
upiter-2005 / Cycle change block content
Created December 29, 2017 21:39
Cycle change block content
$('.rotate-h2 .lang-block').eq(0).addClass('active').fadeIn(1000);
setInterval( function () {
var length = $('.rotate-h2 .lang-block').length - 1;
$('.rotate-h2 .lang-block').each(function(index) {
if($(this).hasClass('active') && index != length) {
$(this).removeClass('active').fadeOut(1000).next('.lang-block').addClass('active').delay(1000).fadeIn(1000);
@upiter-2005
upiter-2005 / popover-dom-content.html
Created April 27, 2018 08:09 — forked from imliam/popover-dom-content.html
Bootstrap 4 - Load Popover Content From DOM
<div id="unique-id" style="display:none;">
<div class="popover-heading">This is a heading</div>
<div class="popover-body">This is HTML content that will be loaded inside a </div>
</div>
<span tabindex="0" role="button" data-toggle="popover" data-placement="bottom" data-popover-content="#unique-id">
Click me to load a popover
</span>
<?php
$idObj = get_category_by_slug('c_edu');
$id = $idObj->term_id;
echo get_cat_name($id) ?>
<?php if ( have_posts() ) : query_posts('cat=' . $id);
while (have_posts()) : the_post(); ?>
<?php $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' );
echo $large_image_url[0]; ?>
@upiter-2005
upiter-2005 / stop propagation menu
Created June 6, 2018 05:13
stop propagation menu
$(".close-calendar").on('click', function(){
$('.inter-calendar').removeClass('open');
});
$('.inter-calendar, .wpbs-widget').click(function(e){
e.stopPropagation();
});