Skip to content

Instantly share code, notes, and snippets.

@molochnyk
molochnyk / Element Non
Last active June 11, 2022 17:25
Element Non (display:none)
.elementHidden{
border: none;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
@molochnyk
molochnyk / ajax-javascript-form
Last active May 26, 2020 13:13
Ajax-Form-Js
<script>
$("form.form").submit(function () {
let th = $(this);
let inputNumber = th.find('input[name=tel]').val();
if(inputNumber.length < 17) return false;
th.find('button[type="submit"]').attr('disabled', 'true');
$.ajax({
function sliceWords() {
let line = document.querySelectorAll('.secten_block_items_doc p');
function cutWords(str, max = 20) {
str.forEach((el) => {
if(el.textContent.length > max) {
let string = el.textContent.trim().split(' ').slice(0, max).join() + ' ...';
el.innerHTML = string;
}
})
return str
@molochnyk
molochnyk / Button Top
Created April 29, 2017 11:13
Button Top
HTML code
<div class="top" title="Наверх">
<i class="fa fa-angle-double-up"></i>
</div>
CSS(SCSS) code
.top{
position: fixed;
bottom: 25px;
right: -100px;
@molochnyk
molochnyk / jQuery Resize Height
Last active April 4, 2017 20:39
jQuery Resize Height
$(document).ready(function() {
function heightDetect(){
$('.main_head').css('height', $(window).height());
};
heightDetect();
$(window).resize(function(){
heightDetect();
})
}); //endReady