Skip to content

Instantly share code, notes, and snippets.

$(document).ready(function(){
$("#menu").on("click","a", function (event) {
//отменяем стандартную обработку нажатия по ссылке
event.preventDefault();
//забираем идентификатор бока с атрибута href
var id = $(this).attr('href'),
//узнаем высоту от начала страницы до блока на который ссылается якорь
<?php
//Принимаем постовые данные
$name=$_POST['name'];
$phone=$_POST['phone'];
//Тут указываем на какой ящик посылать письмо
$to = "79991570874@yandex.ru";
//Далее идет тема и само сообщение
// Тема письма
$subject = "Заявка с сайта";
// Сообщение письма
@sitecustom
sitecustom / Браузерное кеширование
Created February 10, 2017 15:24 — forked from artikus11/.htaccess
Заготовка для подключения браузерного кеширования
Включение кеша браузера
Вариант 1
<ifModule mod_headers.c>
<FilesMatch "\.(js|css|txt)$">
Header set Cache-Control "max-age=604800"
</FilesMatch>
<FilesMatch "\.(flv|swf|ico|gif|jpg|jpeg|png)$">
Header set Cache-Control "max-age=2592000"
@sitecustom
sitecustom / bootstrap-col.css
Created December 23, 2016 15:32
bootstrap sample grid
.col-lg-8, .col-md-8, .col-sm-8, .col-xs-8 {
position: relative;
min-height: 1px;
padding-right: 15px;
padding-left: 15px;
}
.col-xs-8 {
width: 12.5%;
float: left;
@sitecustom
sitecustom / реализация слайдера
Created December 19, 2016 22:30
реализация слайдера
<div class="slide_img" style="background-image: url(img/slide_1.jpg);"></div>
.slide_img {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-size: cover;
}
@sitecustom
sitecustom / overlay
Created December 19, 2016 22:16
overlay
.carousel-inner .overlay {
content: "";
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 1;
background-color: rgba(35,35,35,.67);
}
JS:
$(".accordeon dd").hide().prev().click(function() {
$(this).parents(".accordeon").find("dd").not(this).slideUp().prev().removeClass("active");
$(this).next().not(":visible").slideDown().prev().addClass("active");
});
CSS:
.accordeon .active { color: red }
HTML:
@sitecustom
sitecustom / gist:ccf99cc66a9d34fdab9d0acc5572f860
Created October 23, 2016 17:50 — forked from mpakus/gist:2585435
Sliding menu (JQuery)
<html>
<head>
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<style type="text/css">
body{
margin:0;
padding:0;
}
[[!getPage? &elementClass=`modSnippet` &element=`getResources`]]
@sitecustom
sitecustom / migx-sample.js
Created October 19, 2016 20:54 — forked from agragregra/migx-sample.js
MIGX Sample
Tabs:
[
{"caption":"Tab Title", "fields": [
{"field":"title","caption":"Name"},
{"field":"description","caption":"Description","inputTVtype":"textarea"},
{"field":"imageTV","caption":"Photo","inputTV":"imageTV"}
]}
]
Table: