This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://refreshless.com/nouislider/ | |
<script src="wNumb.min.js"></script> | |
<script src="nouislider.min.js"></script> | |
<link rel="stylesheet" href="/nouislider.min.css"> | |
(function (){ | |
var roundHundred = function(value){ | |
return Math.round(value/100)*100; | |
}; | |
var calcFunc = function () { | |
var calcTotal = document.querySelector('#calc-total'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.hasScrollBar = function() { | |
return this.get(0).scrollWidth > this.width(); | |
} | |
function elWrapScroll() { | |
var $elWrap = $('.el-wrap'); | |
$elWrap.each(function () { | |
if ($(this).hasScrollBar()) { | |
$(this).addClass('is-scroll'); | |
} else { | |
$(this).removeClass('is-scroll'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// mutation | |
var observeObject = function () { | |
var _class = { | |
init: function (selector, callback) { | |
var element = document.querySelector(selector); | |
try { | |
var observer = new MutationObserver(function (mutations) { | |
mutations.forEach(function (mutation) { | |
callback(mutation.target, mutation.attributeName, mutation.oldValue); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.hasScrollBar = function() { | |
return this.get(0).scrollWidth > this.width(); | |
} | |
function wrapScroll() { | |
$('.wrap').each(function () { | |
if ($(this).hasScrollBar()) { | |
$(this).addClass('is-scroll'); | |
} else { | |
$(this).removeClass('is-scroll'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div { | |
max-width: 40em; | |
max-height: 20em; | |
overflow: scroll; | |
position: relative; | |
} | |
table { | |
position: relative; | |
border-collapse: collapse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// !!!dotdotdot-js-2.0.1 | |
/* | |
<div class="truncable-txt"> | |
text, text, text | |
<span class="truncable-txt__more">more</span> | |
<span class="truncable-txt__less">less</span> | |
</div> | |
<style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
<div class="truncable-txt"> | |
text, text, text | |
<span class="truncable-txt__more">more</span> | |
<span class="truncable-txt__less">less</span> | |
</div> | |
<style> | |
.truncable-txt--is-truncated .truncable-txt__more, | |
.truncable-txt--is-not-truncated .truncable-txt__less { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
document.addEventListener("DOMContentLoaded", function (event) { | |
setTimeout(function () { | |
var resource = document.createElement('script'); | |
resource.async = "true"; | |
resource.src = ""; | |
var script = document.getElementsByTagName('script')[0]; | |
script.parentNode.insertBefore(resource, script); | |
}, 3000); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// insertedInit | |
$(insertedInit); | |
function uOrderInitInit(){ | |
var $parent = $('.parent'); | |
var $el = '.el'; | |
$parent.on("DOMNodeInserted", function (event) { | |
$(event.target).find($el).addClass(); | |
}); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// uOrderInitInit | |
$(uOrderInitInit); | |
function uOrderInitInit(){ | |
var $filterOutput = $('.filter-output'); | |
var $uOrder = $('.table-u-order__hint'); | |
var $uOrderEl = '.table-u-order__hint'; | |
var $uOrderParent = 'td'; | |
var $uOrderParentClass = 'table-u-order'; | |
if ($uOrder.length) { | |
$uOrder.parent($uOrderParent).addClass($uOrderParentClass); |