-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.js
25 lines (21 loc) · 909 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
$(document).ready(function() {
// Cargar la página principal por defecto
$("#content").load("pages/home.html");
// Manejar los clics en los enlaces del menú para cargar el contenido correspondiente
$("#navbar").click(function(e) {
e.preventDefault();
let page = $(this).attr("href");
// Cargar la página según el enlace seleccionado
if (page === "/compra_nuevos.html") {
$("#content").load("/pages/compra_nuevos.html");
} else if (page === "/compra_usados.html") {
$("#content").load("/pages/compra_usados.html");
} else if (page === "/remates.html") {
$("#content").load("/remates.html");
}else if (page === "/arriendos.html") {
$("#content").load("/pages/arriendos.html");
} else {
$("#content").load("/pages/contact.html");
}
});
});