Skip to content

Instantly share code, notes, and snippets.

Add tag(preferably near video) canvas <canvas id="exampleCanvas" style="position: absolute;"></canvas>
var vid = document.getElementById('factory-video');
vid.play();
var wrapper = document.getElementById('main-wrapper');
var canvas = document.getElementById('exampleCanvas');
var ctx = canvas.getContext('2d');
@Grytsak
Grytsak / JS Table behavior (block height) emulator
Last active May 28, 2019 12:20
1) Add to parent container class js-table-cell-emulate-wrap 2) Add to elements we want to have same height classes: js-table-cell-emulate js-table-cell-emulate-target and same data-row attr, for example data-row="ppc-feature-title-1" 3) set maxWindowSize to number in pixels to disable table behavior on such screen width and lower
// Table Cell Emulate
(function(ELEMENT) {
ELEMENT.matches = ELEMENT.matches || ELEMENT.mozMatchesSelector || ELEMENT.msMatchesSelector || ELEMENT.oMatchesSelector || ELEMENT.webkitMatchesSelector;
ELEMENT.closest = ELEMENT.closest || function closest(selector) {
if (!this) return null;
if (this.matches(selector)) return this;
if (!this.parentElement) {
return null
} else return this.parentElement.closest(selector)
};
HOLY SMOKES! This one was very troublesome, but I figured it out after days of trying.
So, there are a lot of partial answers out there, but this should be complete. You cannot from what I have seen, include jquery-ui in your angular-cli and the index. The plugin inclusions will be overwritten and jquery as a global will be undefined. I couldn't get it to work by using just the angular-cli.json, but I did get it to work by only using index inclusion.
Here is what needs to be done to only use index script inclusion for jquery/jquery-ui.
1: Uninstall jquery and jquery-ui and remove it from the package.json
npm uninstall --save jquery jquery-ui
2: Delete the node_modules folder
var input = {
"name": "positive",
"children": [{
"name": "product service",
"children": [{
"name": "price",
"children": [{
"name": "cost",
"size": 8
}]
function find(source, name) {
for (key in source)
{
var item = source[key];
if (item.name == name)
return item;
// Item not returned yet. Search its children by recursive call.
if (item.children)
{
<?php if (have_posts() ) : query_posts("p=1") ?>
<?php while (have_posts() ) : the_post();?>
<?php the_title(); ?>
<?php the_content(); ?>
<?php the_post_thumbnail (array(100, 100)) ?>
<?php endwhile; endif; wp_reset_query(); ?>
function heigthDetect() {
$(".main_head").css("height", $(window).height());
};
heigthDetect();
$(window).resize(function() {
heigthDetect();
});