Some vanilla equivalents to jQuery methods.
jQuery:
| /** | |
| * This is a collection of Vanilla JavaScript | |
| * equivalents to jQuery methods. | |
| * | |
| * @author Rhythm Shahriar <rhy@rhythmshahriar.com> | |
| * @link http://rhythmshahriar.com | |
| */ | |
| /**---------------------------------------------------------------------- | |
| * DOM selectors - Dom selectores |
##Sass Functions Cheat Sheet
| ############################################# | |
| # Push de la rama actual | |
| git push origin $rama_actual | |
| ############################################# | |
| # Volver a un commit anterior, descartando los cambios | |
| git reset --HARD $SHA1 | |
| ############################################# | |
| # Ver y descargar Ramas remotas |
| /* Media Queries*/ | |
| $screen-sm-max: 767px; | |
| $screen-sm-min: 768px; | |
| $screen-md-max: 991px; | |
| $screen-md-min: 992px; | |
| $screen-lg-max: 1199px; | |
| $screen-lg-min: 1200px; | |
| @mixin bp-iphone-max { | |
| @media (max-width: 380px) { |
| const scrollToItemId = (containerId, srollToId) => { | |
| const scrollContainer = document.getElementById(containerId); | |
| const item = document.getElementById(scrollToId); | |
| //with animation | |
| const from = scrollContainer.scrollTop; | |
| const by = item.offsetTop - scrollContainer.scrollTop; | |
| if (from < item.offsetTop) { | |
| if (item.offsetTop > scrollContainer.scrollHeight - scrollContainer.clientHeight) { | |
| by = (scrollContainer.scrollHeight - scrollContainer.clientHeight) - scrollContainer.scrollTop; |