Skip to content

Instantly share code, notes, and snippets.

View sealucky7's full-sized avatar

sea-lucky sealucky7

  • My Life :)
View GitHub Profile
@sealucky7
sealucky7 / fixed menu
Created April 30, 2015 10:20
Fixed menu
<div id="menu" class="main_header_bottom">
<div class="header_bottom_wrp">
<div class="phone_wrp"><p class="phone">+375 29 111-54-56</p></div>
<div class="top_mnu_wrp">
<ul class="top_mnu">
<li><a href="javascript:void(0)">главная</a></li>
<li><a href="javascript:void(0)">услуги</a></li>
<li><a href="javascript:void(0)">бюро стилистов</a></li>
<li><a href="javascript:void(0)">обучение</a></li>
<li><a href="javascript:void(0)">выпускники</a></li>
@sealucky7
sealucky7 / back to top
Created April 30, 2015 14:14
Back to top
<div id="top" class="back-to-top"><img src="img/back-to-top.jpg" alt="arrow-to-top"/></div>
<script type="text/javascript">
var top_show = 150; // В каком положении полосы прокрутки начинать показ кнопки "Наверх"
var delay = 1000; // Задержка прокрутки
$(document).ready(function() {
$(window).scroll(function () { // При прокрутке попадаем в эту функцию
/* В зависимости от положения полосы прокрукти и значения top_show, скрываем или открываем кнопку "Наверх" */
if ($(this).scrollTop() > top_show) $('#top').fadeIn();
@sealucky7
sealucky7 / another select
Created May 6, 2015 16:22
Another view select
select {
width: 100px;
height: 26px;
border-radius: 10px;
-webkit-appearance: none;
background-image: url("../img/select_bg.png");
background-position: right center;
background-repeat: no-repeat;
line-height: 1em;
/* for FF */
@sealucky7
sealucky7 / Parallax
Created June 15, 2015 12:15
Parallax
$(window).scroll(function() {
var st = $(this).scrollTop() /10;
$(".object").css({
"transform" : "translate3d(0px, " + st + "%, .01px)",
"-webkit-transform" : "translate3d(0px, " + st + "%, .01px)"
});
});
@sealucky7
sealucky7 / Add class img
Created June 22, 2015 22:12
Добавление класса к элементу
<ul class="small_photo">
<li><img class="active" src="img/img_thumb.png" alt="photo"/></li>
<li><img src="img/img_thumb1.jpg" alt="photo"/></li>
<li><img src="img/img_thumb.png" alt="photo"/></li>
<li><img src="img/img_thumb.png" alt="photo"/></li>
</ul>
$(".small_photo img").click(function() {
$(".small_photo img").removeClass("active");
$(this).addClass("active");
@sealucky7
sealucky7 / Send form mail
Created June 27, 2015 10:24
Send mail all form
<form method="GET" action="hear name files, where code form">
<div class="form min-form" data-name="Отправить">
<input type="hidden" name="cat" value="Отправить">
<input type="hidden" name="utm_source" class="source" value="<?php echo isset($_GET['utm_source']) ? $_GET['utm_source'] : '' ;?>" />
<input type="hidden" name="utm_term" class="term" value="<?php echo isset($_GET['utm_term']) ? $_GET['utm_term'] : '' ;?>" />
<input type="hidden" name="utm_medium" value="<?php echo $_GET['utm_medium'];?>">
<input type="hidden" name="utm_campaign" value="<?php echo $_GET['utm_campaign'];?>">
<input type="hidden" name="utm_content" value="<?php echo $_GET['utm_content'];?>">
<input class="tel" name="tel" type="text" placeholder="Ваш телефон" data-name="Телефон">
<div class="button_conteiner">
@sealucky7
sealucky7 / Tab with css3
Created July 6, 2015 13:09
Tab only css3
<div id="tab">
<input type="radio" name="table" id="n1" checked/>
<label for="n1">Tab 1</label>
<input type="radio" name="table" id="n2"/>
<label for="n2">Tab 2</label>
<input type="radio" name="table" id="n3"/>
<label for="n3">Tab 3</label>
<div id="table">
<div>
// Cache selectors
var lastId,
topMenu = $("#your selector"), // here class or id your menu
topMenuHeight = topMenu.outerHeight()+100,
// All list items
menuItems = topMenu.find("a"),
// Anchors corresponding to menu items
scrollItems = menuItems.map(function(){
var item = $($(this).attr("href"));
if (item.length) { return item; }
$(document).ready(function() {
$("a").click(function () {
var elementClick = $(this).attr("href")
var destination = $(elementClick).offset().top;
jQuery("html:not(:animated),body:not(:animated)").animate({scrollTop: destination - 300}, 800);
return false;
});
/*--------------------- Second method -------------------------*/
$(" your element").click(function()
{
$(this).next("your element").slideToggle('normal');
});