Skip to content

Instantly share code, notes, and snippets.

View manuelcanga's full-sized avatar
🎯
Focusing

Manuel Canga manuelcanga

🎯
Focusing
View GitHub Profile
@manuelcanga
manuelcanga / scripts.js
Created January 7, 2022 19:21
Detectar cambio de orientación móvil( JS )
trasweb.orientationchange = function() {
if(-90 === window.orientation || 90 === window.orientation ) {
alert("Landscape");
}else {
alert("portrait");
}
};
window.addEventListener('orientationchange', function() { trasweb.orientationchange(); } );
trasweb.orientationchange();
@manuelcanga
manuelcanga / scripts.js
Created January 7, 2022 19:19
Cabecera flotante
/** Cambia de cabecera */
var trasweb = {};
trasweb.cabecera = function(slayer){
this.ALTURA_HACER_FLOTANTE_MENU = 400;
this.cabecera = document.getElementById(slayer);
this.getScroll = function () {
@manuelcanga
manuelcanga / index.html
Created January 7, 2022 19:17
Eliminar el label de "aún no se ha seleccionado ningún archivo"
<div>
<input type='file'/>
<span id='val'></span>
<span id='button'>Select File</span>
</div>
@manuelcanga
manuelcanga / index.html
Created January 7, 2022 19:14
Subida de imágenes con previo
<input type='file' onchange="previewImage(this, 'preview-image');" />
<img id="preview-image" src="http://placehold.it/300" alt="image preview" />