Skip to content

Instantly share code, notes, and snippets.

View dkruchok's full-sized avatar

Dima Kruchok dkruchok

View GitHub Profile
@dkruchok
dkruchok / common.js
Created May 22, 2015 12:27
Выезд меню сбоку боди
/* Push the body and the nav over by 285px over
$('.nav.burger a').click(function() {
$('.hidden_menu').animate({
left: "0px"
}, 200);
$('body').animate({
left: "285px"
}, 200);
});*/
@dkruchok
dkruchok / slider for current
Created May 21, 2015 19:02
My custom slider for current picture
var small = $(".from litle a img"),
big = $(".to big img");
small.each(function(i, el) {
var next = i + 1 == small.size() ? 0 : i + 1;
$(el)
.click(
function(event) {
event.preventDefault();
if (big.data("next") == next) return;
big.fadeTo(500, 0.1, function() {
@dkruchok
dkruchok / jq for iphone
Created May 21, 2015 19:00
Iphone click function
$(document).on('touchstart click', '.class', function() {
$(".menu_container").fadeIn(600)
});
$(document).on('touchstart click', '.class to close', function() {
$(".menu_container").fadeOut(600)
});
@dkruchok
dkruchok / Custom hover hide block
Created May 21, 2015 18:57
Всплывашка блока при наведении.
<div class="cont">
<ul>
<li>
<a href="#">
<h3>title</h3>
</a>
<div class="hide_block">
<div class="hide_block_inner">
<div class="text">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Recusandae.</div>
@dkruchok
dkruchok / Scroll detect
Created May 21, 2015 18:44
Фиксривованый хедер после скрола в низ
$(window).scroll(function() {
if ($(document).scrollTop() > 130) {
$("body").addClass("top_menu_small");
} else {
$("body").removeClass("top_menu_small");
}
});
<?php
$post = $wp_query->post;
if (in_category('cat_label_1')) {
include(TEMPLATEPATH.'/single-cat_label_1.php');
} elseif (in_category('cat_label_2')) {
include(TEMPLATEPATH.'/single-cat_label_2.php');
}
?>