Skip to content

Instantly share code, notes, and snippets.

let pushState = history.pushState;
let self = this;
history.pushState = function () {
pushState.apply(history, arguments);
self.fireEvents('pushState', arguments);
};
var event = new Event('build');
elem.addEventListener('build', function (e) { ... }, false);
elem.dispatchEvent(event);
const xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = () => {
if (xmlHttp.readyState === XMLHttpRequest.DONE) {
const response = xmlHttp.responseText;
this.loadReport(reportName, response);
}
};
@HugoGv
HugoGv / accordeon-vertical-jquery
Created November 17, 2017 14:03 — forked from gearmobile/accordeon-vertical-jquery
Accordeon Vertical jQuery
JADE:
section.accordeon__wrapper
ul.accordeon
li.accordeon__item
a.accordeon__trigger(href="#{js}") accordeon item 1
ul.accordeon__inner
li.accordeon__inner__item: a.accordeon__inner__link(href="#{js}") accordeon inner link 1
li.accordeon__inner__item: a.accordeon__inner__link(href="#{js}") accordeon inner link 2
li.accordeon__inner__item: a.accordeon__inner__link(href="#{js}") accordeon inner link 3
li.accordeon__item
//кнопка наверх
$(window).scroll(function() {
if ($(this).scrollTop() > $(this).height()) {
$('.top').addClass('active');
} else {
$('.top').removeClass('active');
}
});
$('.top').click(function() {
$('html, body').stop().animate({scrollTop: 0}, 'slow', 'swing');
@HugoGv
HugoGv / button.sass
Created October 20, 2017 14:17 — forked from agragregra/button.sass
Button Sass Styles (Universal Starter)
.button
display: inline-block
border: none
color: #fff
text-decoration: none
background-color: $accent
padding: 15px 45px
font-size: 13px
text-transform: uppercase
font-weight: 600