Skip to content

Instantly share code, notes, and snippets.

View zdimaz's full-sized avatar
😄

zdimaz

😄
View GitHub Profile
@zdimaz
zdimaz / The Wizard of Oz, 1939
Last active December 21, 2021 11:46
emits vue 3 js
<!--
From the child component, you want to do an "emit".
This tells the parent to run the callback specified
in the child component reference. Psuedo code:
-->
<child>
<button @click="send()">Click Me</button>
methods: {
@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 / disabled write words to input
Last active July 28, 2021 08:41
disabled write words to input
.replace(/[^0-9]/g, '');
exapmle
var val = $(this).prop("value").replace(/[^0-9]/g, '');
/**
** Input Number
**/
inputNumber: function(){
@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.plugins.js
Created May 12, 2020 08:39
jq ajax form simple
/* ==============================================
Name function
============================================== */
if($("form").length){
$('form').submit(function(e) {
e.preventDefault();
@zdimaz
zdimaz / js
Last active March 16, 2020 12:43
click target (not child)
Если e.target - это тот же самый элемент, что и this, вы не нажали на потомка.
$('.foobar').on('click', function(e) {
if (e.target !== this){
return;
};
alert( 'clicked the foobar' );
@zdimaz
zdimaz / js
Last active November 11, 2019 12:58
table slinky plugin
/* basic table sticky*/
.wrapp_table_sticky{
overflow: hidden;
}
.wrapp_table_sticky .inner_table_sticky{
overflow: auto;
padding: 20px 0;
margin: -20px 0;
@zdimaz
zdimaz / script.core.js
Last active September 2, 2019 10:23
accordion plugin jq
self.jqueryExtend();
/*
*
*
* Accordion
*
*/
@zdimaz
zdimaz / jq fn
Created August 29, 2019 20:29
parralax jq fn
$(document).ready(function(){
$('section[data-type="background"]').each(function(){
var $bgobj = $(this); // создаем объект
$(window).scroll(function() {
var ypos = -($window.scrolltop() / $bgobj.data('speed')); // вычисляем коэффициент
// присваиваем значение background-position
var coords = 'center '+ ypos + 'px';
// создаем эффект parallax scrolling
$bgobj.css({ backgroundposition: coords });
<div class="gmap" id="gmap" data-gmap-type="mapBox"
data-coords='[{"lat": 55.775723, "lon": 49.196191, "title":""}]'></div>
if($('.gmap').length){
self.googleMaps();
}