Skip to content

Instantly share code, notes, and snippets.

Bogdan molochnyk

Block or report user

Report or block molochnyk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@molochnyk
molochnyk / jQuery Resize Height
Last active Apr 4, 2017
jQuery Resize Height
View jQuery Resize Height
$(document).ready(function() {
function heightDetect(){
$('.main_head').css('height', $(window).height());
};
heightDetect();
$(window).resize(function(){
heightDetect();
})
}); //endReady
View 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;
View gist:3a673ac93f33e4d9581e958bbdde9c89
<script>
$("form.callback").submit(function () { //Change
var th = $(this);
$.ajax({
type: "POST",
url: "mail.php", //Change
data: th.serialize()
}).done(function () {
$(th).find('.success').addClass('active').css('display', 'flex').hide().fadeIn();
setTimeout(function () {
View gist:6dd8b8f7a7c27a6291c037775f0b4b9b
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 / Element Non
Created Aug 3, 2019
Element Non (display:none)
View Element Non
.elementHidden{
border: none;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
You can’t perform that action at this time.