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
<input type='file' onchange="previewImage(this, 'preview-image');" /> | |
<img id="preview-image" src="http://placehold.it/300" alt="image preview" /> |
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
<div> | |
<input type='file'/> | |
<span id='val'></span> | |
<span id='button'>Select File</span> | |
</div> |
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
/** Cambia de cabecera */ | |
var trasweb = {}; | |
trasweb.cabecera = function(slayer){ | |
this.ALTURA_HACER_FLOTANTE_MENU = 400; | |
this.cabecera = document.getElementById(slayer); | |
this.getScroll = function () { |
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
trasweb.orientationchange = function() { | |
if(-90 === window.orientation || 90 === window.orientation ) { | |
alert("Landscape"); | |
}else { | |
alert("portrait"); | |
} | |
}; | |
window.addEventListener('orientationchange', function() { trasweb.orientationchange(); } ); | |
trasweb.orientationchange(); |
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
jQuery(document).ready(function($){ | |
nsZoomZoom(); | |
$( window ).resize(function() { | |
nsZoomZoom(); | |
}); | |
function nsZoomZoom() { |
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
/** | |
Alternativa de menos de 1kb: https://apoorv.pro/lozad.js/demo/ | |
*/ | |
document.addEventListener('DOMContentLoaded', function () { | |
var bLazy = new Blazy({ | |
src: 'data-src', | |
selector: '*[data-src]', | |
offset: 500, | |
breakpoints: [ |
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
/** Basado en: https://stackoverflow.com/questions/15040408/achieving-min-width-with-viewport-meta-tag */ | |
document.addEventListener('DOMContentLoaded', function () { | |
trasweb.orientationchange(); | |
}); | |
trasweb.orientationchange = function (force_orientation) { | |
var vp = document.getElementById('viewport'); | |
var orientation = window.orientation; | |
var is_desktop = document.body.classList.contains('desktop'); |
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
trasweb.getPosition = function (el) { | |
var xPos = 0; | |
var yPos = 0; | |
while (el) { | |
if (el.tagName === "BODY") { | |
// deal with browser quirks with body/window/document and page scroll | |
var xScroll = el.scrollLeft || document.documentElement.scrollLeft; | |
var yScroll = el.scrollTop || document.documentElement.scrollTop; |
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
trasweb = trasweb | {}; | |
trasweb.getSize = function () { | |
var w = window, | |
d = document, | |
e = d.documentElement, | |
g = d.getElementsByTagName('body')[0], | |
x = w.innerWidth || e.clientWidth || g.clientWidth, | |
y = w.innerHeight || e.clientHeight || g.clientHeight; |
OlderNewer