Skip to content

Instantly share code, notes, and snippets.

View carolina-vallejo's full-sized avatar

Carolina Vallejo carolina-vallejo

  • ITONICS, GmbH
  • Berlin
View GitHub Profile
@carolina-vallejo
carolina-vallejo / load-script-console.js
Created September 26, 2017 14:59
load script console
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://code.jquery.com/jquery-3.2.1.min.js';
document.head.appendChild(script);
@carolina-vallejo
carolina-vallejo / font-responsive.js
Created September 26, 2017 11:07
font responsive #javascript
$(window).load(function() {
//----ADJUST FONTSIZE IN MOBILE
if (isMobile()) {
$('h1, h2, h3, h4').each(function() {
var $this = $(this);
var text = $this.text();
$this.empty().append('<span style="color:inherit">' + text + '</span>');
var width = $this.width();
@carolina-vallejo
carolina-vallejo / fixed-nav.js
Created September 26, 2017 08:28
fixed nav jquery javascript
fixednav();
$(window).scroll(function() {
fixednav();
});
function fixednav() {
@carolina-vallejo
carolina-vallejo / jump-to-slide.js
Created September 25, 2017 14:30
jump to slide owl carousel
$owlHistory.trigger('to.owl.carousel', [0,100]);
@carolina-vallejo
carolina-vallejo / disable-interaction-leaflet.js
Created September 24, 2017 12:48
disable interaction leaflet
leafletMap.dragging.disable();
leafletMap.touchZoom.disable();
leafletMap.doubleClickZoom.disable();
leafletMap.scrollWheelZoom.disable();
leafletMap.boxZoom.disable();
leafletMap.keyboard.disable();
if (leafletMap.tap) leafletMap.tap.disable();
document.getElementById('mapid').style.cursor = 'default';
@carolina-vallejo
carolina-vallejo / shuffle-array.js
Created September 21, 2017 08:52
shuffle array javascript
function shuffle(array) {
var currentIndex = array.length,
temporaryValue, randomIndex;
// While there remain elements to shuffle...
while (0 !== currentIndex) {
// Pick a remaining element...
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex -= 1;
@carolina-vallejo
carolina-vallejo / random.js
Created September 18, 2017 18:33
random function javascsript
function getRnd(max, min) {
return Math.random() * (max - min) + min;
}
@carolina-vallejo
carolina-vallejo / close-icon-font.html
Last active December 10, 2017 12:58
close icon font use with @charset UTF-8 in css
<a href="#" class="close-btn">×</a>
@carolina-vallejo
carolina-vallejo / exisiting-folder.txt
Last active December 28, 2017 19:20
#git git existing folder
cd existing_folder
git init
git remote add origin [email protected]:radiodraws/react-gist-app.git
git add .
git commit -m "Initial commit"
git push -u origin master
console.log('<br>Computed style width as pixels: ');
console.log(node.style('width'));
console.log('<br>Computed style width as a number: ');
console.log(parseFloat(node.style('width')));
console.log('<br>As a percent: ');
console.log(node.node().style.width);
console.log('<br>Actual width as number: ');
console.log(node.node().offsetWidth);