Skip to content

Instantly share code, notes, and snippets.

View Serega1288's full-sized avatar

Sergii Serega1288

View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Shuffle.js</title>
</head>
<body class="home">
@Serega1288
Serega1288 / index.html
Last active January 1, 2016 19:51
widgets_init wp
<?php
//functions.php
function boss_widgets_init() {
register_sidebar( array(
'name' => __( 'шаблон контакты позиция справа', 'boss' ),
'id' => 'sidebar-contacts-right',
'description' => __( '50% ширины от размера контента', 'boss' ),
'before_widget' => ' ',
'after_widget' => ' ',
'before_title' => '<strong>',
@Serega1288
Serega1288 / style.css
Created November 21, 2015 19:04
центровка текста по вертикати css
.text-block {
height: 135px;
display: inline-table;
overflow: hidden;
}
.text-block p {
display: table-cell;
vertical-align: middle;
}
@Serega1288
Serega1288 / index.php
Created November 17, 2015 20:03
if else:
<?php
if ($foo);
echo "yep\n";
elseif ($bar);
echo "almost\n";
else;
echo "nope\n";
endif;
@Serega1288
Serega1288 / php
Created November 17, 2015 06:45
wp_nav_menus options
<?php
//index.php
$defaults = array(
'theme_location' => 'menu',
'menu' => '',
'container' => '',
'container_class' => '',
'container_id' => '',
'menu_class' => 'menu',
@Serega1288
Serega1288 / script.js
Last active August 2, 2016 10:09
anime click scroll #
jQuery(function($) {
//Ajax contact
var form = $('.contact-form');
form.submit(function () {
$this = $(this);
$.post($(this).attr('action'), function(data) {
$this.prev().text(data.message).fadeIn().delay(3000).fadeOut();
@Serega1288
Serega1288 / script.js
Created November 13, 2015 08:00
setTimeout js
/***************************/
function explode(){
alert("Boom!");
}
setTimeout(explode, 2000);
/***************************/
var explode = function(){
alert("Boom!");
};
@Serega1288
Serega1288 / script.js
Last active March 7, 2016 08:22
scrollTop to window
$(window).scroll(function() {
if ($(this).scrollTop() > 1){
$('header').addClass("sticky");
}
else{
$('header').removeClass("sticky");
}
});
@Serega1288
Serega1288 / style.css
Created November 12, 2015 15:24
placeholder
::-webkit-input-placeholder {color:#000;}
::-moz-placeholder {color:#000;}/* Firefox 19+ */
:-moz-placeholder {color:#000;}/* Firefox 18- */
:-ms-input-placeholder {color:#000;}
@Serega1288
Serega1288 / css
Last active November 13, 2015 11:35
css transition
{
-o-transition: all 1.4s ease;
-moz-transition: all 1.4s ease;
-webkit-transition: all 1.4s ease;
transition: all 1.4s ease;
}
сss
---------------------------
.image {