This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<nav class="nav"> | |
<ul> | |
<li>Главная</li> | |
<li>Услуги</li> | |
<li>О нас</li> | |
<li>Контакты</li> | |
</ul> | |
</nav> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
$("#menu").on("click","a", function (event) { | |
//отменяем стандартную обработку нажатия по ссылке | |
event.preventDefault(); | |
//забираем идентификатор бока с атрибута href | |
var id = $(this).attr('href'), | |
//узнаем высоту от начала страницы до блока на который ссылается якорь | |
top = $(id).offset().top; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- html --> | |
<div id="menu"> | |
<ul> | |
<li><a href="#1"></a><span>Индивидуальный пошив</span></li> | |
<li><a href="http://css-live.ru/articles-css/ravnomernoe-vyravnivanie-blokov-po-shirine.html"></a><span>Технология</span></li> | |
<li><a href="#3"></a><span>Ткани</span> | |
<ul> | |
<li><a href="#"></a><span>дроп даун</span></li> | |
<li><a href="#"></a><span>дроп даун</span></li> | |
<li><a href="#"></a><span>дроп даун</span></li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Cache selectors | |
var lastId, | |
topMenu = $(".fixed-nav"), | |
topMenuHeight = topMenu.outerHeight() + 15, | |
// All list items | |
menuItems = topMenu.find("a"), | |
// Anchors corresponding to menu items | |
scrollItems = menuItems.map(function() { | |
var item = $($(this).attr("href")); | |
if (item.length) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.formLine-form input[type="checkbox"]').change(function(event) { | |
testCheckPolit($(this)); | |
}); | |
// Если чекбокс выбран то активируем кнопку отправки если нет деактивируем | |
function testCheckPolit(el){ | |
if(el.prop('checked')){ | |
el.closest('form').find('button, input[type="submit"]').removeAttr('disabled'); | |
}else { | |
el.closest('form').find('button, input[type="submit"]').attr('disabled', 'disabled'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteCond %{HTTP_HOST} ^www\.(.*)$ | |
RewriteRule ^(.*)$ http://%1/$1 [L,R=301] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createCookie(name, value, days) { | |
var expires; | |
if (days) { | |
var date = new Date(); | |
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); | |
expires = "; expires=" + date.toGMTString(); | |
} else { | |
expires = ""; | |
} | |
document.cookie = name + "=" + value + expires + "; path=/"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(document.cookie.match(/debug=([^\;]*)/) != null){ | |
console.log('debug'); | |
}; | |
if(isset($_COOKIE['debug'])){ | |
$var = 'dfsdfsd'; | |
echo "<pre style='display: none;' data-fsdfsdsdsdf4444='dfhnksdfl'>"; | |
var_dump($var); | |
echo "</pre>"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
document.addEventListener("DOMContentLoaded", openModalLogin);//Когда загрущзиться jquery запустим наш скрипт запуска модалки | |
function openModalLogin(){ $(".login-btn-in a").trigger('click'); }; | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WPDB snipets | |
global $wpdb; | |
// SELECT выборка самых свежих записей | |
$var = 'CONFIRMED'; | |
$sql = $wpdb->prepare( "SELECT `status`,`order_id`, timestamp( `timestamp` ) as 'timestamp_column' | |
FROM `payments` | |
WHERE `status` = 'CONFIRMED' | |
ORDER BY `timestamp_column` DESC", $var); | |
OlderNewer