Skip to content

Instantly share code, notes, and snippets.

#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;
@imgsrc
imgsrc / Jquery Resize Height
Created November 30, 2016 15:22
Jquery Resize Height
function heightDetect() {
$(".main_head").css("height", $(window).height());
};
heightDetect();
$(window).resize(function () {
heightDetect();
});
@imgsrc
imgsrc / functions.php
Created December 10, 2016 06:05
Создание поля опций в Wordpress
function my_more_options() {
//создаём поле опции
add_settings_field(
'phone', // $id - Название опции (идентификатор)
'Телефон', // $title - Заголовок поля
'display_phone', // $callback - callback function
'general' // $page - Страница меню в которую будет добавлено поле
);
@imgsrc
imgsrc / functions.php
Created December 10, 2016 06:06
Создание виджета
register_sidebar(array(
'name' => 'Социальные иконки',
'id' => 'icons_header',
'description' => 'Используйте виджет Текст для добавления HTML-кода иконок',
'before_widget' => '',
'after_widget' => ''
)
);
@imgsrc
imgsrc / functions.php
Created December 10, 2016 06:29
Регистрация меню
register_nav_menu('menu', 'Primary menu');
@imgsrc
imgsrc / functions.php
Created December 10, 2016 06:40
Регистрация нескольких меню
register_nav_menus(array(
'header_menu' => 'Главное меню',
'adaptive_menu' =>'Мобильное меню'
));
@imgsrc
imgsrc / common.js
Created December 13, 2016 10:05
Анимация выпадающей формы
$.fn.extend({
animateCss: function (animationName) {
var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
this.addClass('animated ' + animationName).one(animationEnd, function () {
$(this).removeClass('animated ' + animationName);
});
}
});
var btn = $(".btn_phone");
@imgsrc
imgsrc / index.php
Created December 17, 2016 18:42
Wordpress query posts
<?php if ( have_posts() ) : query_posts('p=1');
while (have_posts()) : the_post(); ?>
<?php the_title(); ?>
<?php the_content(); ?>
<?php the_post_thumbnail(array(100, 100)); ?>
<? endwhile; endif; wp_reset_query(); ?>
@imgsrc
imgsrc / common.js
Created January 17, 2017 11:29
Parallax for Stellar
//Parallax for Stellar
$('.parallax').stellar({
verticalOffset: 300,
horizontalScrolling: false,
verticalScrolling: true,
parallaxBackgrounds: true,
offsetParent: true,
backgroundRatio: 2
});
@imgsrc
imgsrc / common.js
Created January 17, 2017 11:29
WOW animated plugin
var wow = new WOW(
{
boxClass: 'wow',
animateClass: 'animated',
offset: 100, // отступ до элемента, когда будет срабатывать анимация, по умолчанию 0
mobile: false,
live: true
}
);
wow.init();