Skip to content

Instantly share code, notes, and snippets.

View gabydevdev's full-sized avatar

Gabriela Carral gabydevdev

View GitHub Profile
@gabydevdev
gabydevdev / random-class.js
Last active May 2, 2020 19:12
add random classes - js
(function($){
$(document).ready(function() {
var classes = [ 'style1', 'style2', 'style3' ]; // the classes you want to add
$('.item').each(function(i) { // the element(s) you want to add the class to.
$(this).addClass(classes[ Math.floor( Math.random()*classes.length ) ] );
});
});
})(jQuery);
@gabydevdev
gabydevdev / jquery-boilerplate.js
Last active October 7, 2017 02:43 — forked from tommcfarlin/jquery-boilerplate.js
How to properly add jQuery scripts to WordPress
// Loading scripts in footer
(function($) {
"use strict";
// example for document ready
$(document).ready(function() {
// Your code here
});
}(jQuery));