A Pen by Piotr Łepkowski on CodePen.
This file contains hidden or 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
function splitTable(table, maxHeight) { | |
var header = table.children("thead"); | |
var footer = table.children("tfoot"); | |
if (!header.length) | |
return; | |
var headerHeight = header.outerHeight(); | |
var header = header.detach(); | |
var splitIndices = [0]; | |
var rows = table.children("tbody").children(); | |
maxHeight -= headerHeight; |
This file contains hidden or 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
calculateTotal(){ | |
let c; | |
c = this.state.others.map((item) => { | |
if(item.spendingAmmount) { | |
return parseInt(item.spendingAmmount) | |
} | |
return 0; | |
}); | |
let total = 0; | |
if(c.length) { |
This file contains hidden or 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
AA.inView = (function(){ | |
function visibleY(el){ | |
var rect = el.getBoundingClientRect(), | |
top = rect.top, | |
height = rect.height, | |
el = el.parentNode; | |
do { | |
rect = el.getBoundingClientRect(); | |
if (top <= rect.bottom === false) return false; |
This file contains hidden or 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
var hasClass, addClass, removeClass; | |
if ('classList' in document.documentElement) { | |
hasClass = function (el, className) { return el.classList.contains(className); }; | |
addClass = function (el, className) { el.classList.add(className); }; | |
removeClass = function (el, className) { el.classList.remove(className); }; | |
} else { | |
hasClass = function (el, className) { | |
return new RegExp('\\b'+ className+'\\b').test(el.className); | |
}; | |
addClass = function (el, className) { |
This file contains hidden or 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
<?php | |
add_filter( 'nav_menu_css_class', 'pwp_cpt_current_item_class', 10, 2 ); | |
function pwp_cpt_current_item_class( $classes , $item ){ | |
$type = get_post_type_object(get_post_type()); | |
if(!empty($type->rewrite['slug'])) { | |
if (get_post_type() == $type->name || is_archive($type->rewrite['slug'])) { | |
$classes = str_replace('current_page_parent', '', $classes); |
This file contains hidden or 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
<!-- Swiper --> | |
<div class="swiper-container"> | |
<div class="swiper-wrapper"> | |
<div class="swiper-slide"> | |
<div class="slide-inner" style="background-image: url('http://cs412624.vk.me/v412624691/4117/RWBNZL6CLtU.jpg')"></div> | |
</div> | |
<div class="swiper-slide"> | |
<div class="slide-inner" style="background-image: url('http://cs412624.vk.me/v412624691/41ad/atM6w55Z9Xg.jpg')"></div> | |
</div> | |
<div class="swiper-slide"> |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
Fixed element appears to change color when entering different sections. Uses duplicated elements for every section.
Now with blend-mode magic for added effect.
Inspired by Marco Fugaro's Pen Changing color when hover another section.
NewerOlder