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
function CoolModule() { | |
var something = "cool"; | |
var another = [1, 2, 3]; | |
function doSomething() { | |
console.log( something ); | |
} | |
function doAnother() { | |
console.log( another.join( " ! " ) ); |
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
var ModuleExample = { | |
init: function() { | |
var _self = this; | |
var varExample = $('form.variations_form'); | |
function exampleFunction() { | |
console.log(this); | |
} | |
} | |
}; |
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
// Check to see if an element is in the viewport | |
function elementInViewport(el) { | |
var top = el.offsetTop; | |
var left = el.offsetLeft; | |
var width = el.offsetWidth; | |
var height = el.offsetHeight; | |
while (el.offsetParent) { | |
el = el.offsetParent; | |
top += el.offsetTop; |
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
<h1>Heading 1</h1> | |
Nulla eu erat dolor. <strong>Vestibulum</strong> vel eleifend libero. Donec molestie urna posuere egestas suscipit. Nunc id porttitor nulla. Nulla facilisi. In hac habitasse platea dictumst. <a href="http://www.google.com" target="_blank">Maecenas</a> quis condimentum ipsum. Suspendisse potenti. Cras eget <em>tristique</em> nulla, nec tempus arcu. Donec pulvinar sapien a sapien lobortis, eget egestas augue interdum. Curabitur imperdiet urna et pellentesque convallis. Morbi id risus ex. Morbi condimentum gravida odio. <del>Vestibulum</del> fermentum molestie vestibulum. Phasellus pretium nulla arcu, at pellentesque diam efficitur vitae. | |
<h2>Heading 2</h2> | |
Nulla eu erat dolor. Vestibulum vel eleifend libero. Donec molestie urna posuere egestas suscipit. Nunc id porttitor nulla. Nulla facilisi. In hac habitasse platea dictumst. Maecenas quis condimentum ipsum. Suspendisse potenti. Cras eget tristique nulla, nec tempus arcu. Donec pulvinar sapien a sapien lobortis, eget egestas augue interdum. |
- for UX where navigation flies in from the side of the screen or a rollup that swoops in from the bottom of the screen, use
translate3d()
. - the advantage is that you do not need to know the height or width. Whereas using negative
margin
ortop, bottom, etc
requires that an exact measurement to push off screen - add
transition: transform 0.5s
to have it smoothly move in and out.
transform: translate3d(0, 100%, 0); // push off screen
- Click on Windows Start button and type in "NotePad"
- Right click on NotePad and click "Run as Administrator"
- Click File > Open and navigate to:
C:\windows\system32\drivers\etc\
- Select "All files" to reveal "hosts" files and open it
- Add the following (or another localhost IP) to the bottom of
hosts
file
192.168.50.4 example.dev
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
const playing = document.querySelector('.community__song-playing'); | |
const btn = document.querySelector('button.btn-like'); | |
var observer = new MutationObserver(function(mutations) { | |
mutations.forEach(function(mutation) { | |
if (mutation.type == "attributes") { | |
btn.click(); | |
console.log("me_debug", "playing attributes changed") | |
} | |
}); |
OlderNewer