Skip to content

Commit

Permalink
sacando doctype y agregando try catch
Browse files Browse the repository at this point in the history
  • Loading branch information
SebasTerco73 committed May 22, 2024
1 parent 57c4e34 commit 9db48c2
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
1 change: 0 additions & 1 deletion form-contacto.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<!DOCTYPE html>
<html lang="es">

<head>
Expand Down
1 change: 0 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<!DOCTYPE html>
<html lang="es">

<head>
Expand Down
30 changes: 17 additions & 13 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
const sliderInner = document.querySelectorAll('.slider--inner');

let counter = 1;
slidefun(counter);

try{
slidefun(counter);
}catch (TypeError){}

let timer = setInterval(autoslide, 8000);

Expand All @@ -28,19 +31,18 @@ function resetTimer() {
}

function slidefun(n) {
for (let i = 0; i < sliderInner.length; i++) {
sliderInner[i].style.display = "none";
}
for (let i = 0; i < sliderInner.length; i++) {
sliderInner[i].style.display = "none";
}

if (n > sliderInner.length) {
counter = 1;
}

if (n < 1) {
counter = sliderInner.length;
}
if (n > sliderInner.length) {
counter = 1;
}

sliderInner[counter - 1].style.display = "block";
if (n < 1) {
counter = sliderInner.length;
}
sliderInner[counter - 1].style.display = "block";
}

// FIN DEL SLIDE
Expand Down Expand Up @@ -71,4 +73,6 @@ function isValidNumber(number){
return numberRegex.test(number);
}

document.getElementById("myForm").addEventListener("submit",validateForm);
try{
document.getElementById("myForm").addEventListener("submit",validateForm);
}catch (TypeError){}
1 change: 0 additions & 1 deletion menu.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
Expand Down
1 change: 0 additions & 1 deletion nosotros.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<!DOCTYPE html>
<html lang="es">

<head>
Expand Down

0 comments on commit 9db48c2

Please sign in to comment.