SW/assets/js/cambiarCSS.js

22 lines
656 B
JavaScript
Raw Normal View History

2021-05-28 14:21:10 +02:00
/**
* Práctica - Sistemas Web | Grupo D
* CompluCine - FDI-cines
*/
2021-05-26 09:03:02 +02:00
function cambiarCSS(nuevo){
2021-06-04 12:38:17 +02:00
if(nuevo.includes("main.css")){
2021-06-04 23:47:23 +02:00
var css = "main.css";
2021-06-04 12:38:17 +02:00
} else {
2021-06-04 23:47:23 +02:00
var css = "highContrast.css";
2021-06-04 12:38:17 +02:00
}
2021-06-04 23:47:23 +02:00
var url = "../assets/php/common/changeCSS.php?css=" + css;
2021-06-04 12:38:17 +02:00
$.get(url);
/* La idea era que cambiase todo dinámicamente sin refrescar la página */
2021-06-04 23:47:23 +02:00
document.getElementById('estilo').setAttribute('href', nuevo);
2021-06-04 12:38:17 +02:00
//document.getElementById('cssChange').innerHTML = oldName;
//document.getElementById('cssChange').setAttribute('onClick', 'cambiarCSS('+viejo+')');
location.reload();
2021-05-26 09:03:02 +02:00
}