Skip to content

Instantly share code, notes, and snippets.

View zdimaz's full-sized avatar
😄

zdimaz

😄
View GitHub Profile
@zdimaz
zdimaz / js
Created September 4, 2018 12:12
Sticky block
// sticky
function asideSticky() {
// body...
var asideItem = $('.aside_navigation'),
asideItemOffset = asideItem.offset().top;
$(window).scroll(function(){
if( $(this).scrollTop() > asideItemOffset ){
asideItem.addClass('sticky');
@zdimaz
zdimaz / js
Last active October 25, 2021 08:27
btn to top scroll
js
$(window).on("scroll", function(){
if ($(this).scrollTop() > 100) {
$('.btn_scrollup').fadeIn();
} else {
$('.btn_scrollup').fadeOut();
}
});
@zdimaz
zdimaz / js
Last active December 7, 2018 10:57
Video script
var video_kitchen = $('#video_kitchen');
$('#custom_play_kitchen').on("click", function(){
$('#video_wrap_kitchen').toggleClass('active');
if(video_kitchen[0].paused) {
video_kitchen[0].play();
}
else {
@zdimaz
zdimaz / js
Created June 18, 2018 14:36
Script real date (скрипт реальной даты)
function clock() {
var d = new Date();
var month_num = d.getMonth()
var day = d.getDate();
var hours = d.getHours();
var minutes = d.getMinutes();
var seconds = d.getSeconds();
month=new Array("01", "02", "03", "04", "05", "06",
"07", "08", "09", "10", "11", "12");
@zdimaz
zdimaz / style.css
Last active February 19, 2021 15:45
css basic grid
/* --------------------------------------------
basic float grid
-------------------------------------------- */
.row {
margin-left: -15px;
margin-right: -15px;
}
.row::before,
@zdimaz
zdimaz / script.core.js
Last active February 15, 2019 14:02
click triger outside
$(document).on('click', function(e) {
if (!$(e.target).closest(".search-header, .search-header-dropdown").length) {
$(".search-header-dropdown").slideUp();
}
e.stopPropagation();
});
@zdimaz
zdimaz / js
Created May 2, 2018 19:50
Select open item (div)
<section>
<select id="selectOptions">
<option data-name="man">
man1
</option>
<option data-name="woman">
woman
</option>
<option data-name="child" selected>
@zdimaz
zdimaz / script.core.js
Last active April 26, 2018 08:33
File input js
div.input_file_box
a(href="javascript:;").files_btn
| Прикрепить документ
span.name_file
a(href="javascript:;" class="clear_file")
@zdimaz
zdimaz / Open block from id
Last active June 27, 2019 10:21
Открытие блока по id
====================================================================================================
<a data-id="box">
<block data-id="box">
/**
** tabs to Id
**/
@zdimaz
zdimaz / animtate js + css
Last active February 22, 2018 08:09
Анимация при скроллинге страницы
Анимация при скроллинге страницы
/**
** Handling animation when page has been scrolled
**/
animatedContent : function(){
$("[data-animation]").each(function() {