Skip to content

Instantly share code, notes, and snippets.

@fabianra999
fabianra999 / vanillajsjquery.md
Created April 4, 2018 16:33 — forked from rayantony/vanillajsjquery.md
Vanilla JS and Jquery

Vanilla JavaScript

Some vanilla equivalents to jQuery methods.

DOM selectors

jQuery:

@fabianra999
fabianra999 / vanilla.js
Last active August 31, 2020 13:36 — forked from RhythmShahriar/vanilla.js
This is a collection of Vanilla JavaScript equivalents to jQuery methods.
/**
* 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
@fabianra999
fabianra999 / Operaciones-Git
Created April 4, 2018 14:30 — forked from jelcaf/Operaciones-Git
Git Tips - Mini-trucos de Git para facilitarme la tarea
#############################################
# 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
@fabianra999
fabianra999 / _media_mixins.scss
Created October 17, 2017 20:50 — forked from barbwiredmedia/_media_mixins.scss
Sass Mixins & Bootstrap breakpoint media mixins
/* 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) {
@fabianra999
fabianra999 / scroll.js
Created October 5, 2017 19:28 — forked from Fabiantjoeaon/scroll.js
Vanilla JS (ES6) smooth scrolling w/ Easing functions
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;
@fabianra999
fabianra999 / README.md
Created September 22, 2017 19:24 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})