Skip to content

Commit

Permalink
Social reorder script
Browse files Browse the repository at this point in the history
  • Loading branch information
FLAK-ZOSO committed May 20, 2023
1 parent 1a7745a commit d00d223
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
2 changes: 0 additions & 2 deletions capitello-corinzio.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,4 @@ <h2>The most precious pieces of the collection.</h2>
<h1><a href="mailto:[email protected],[email protected]">Contact us if you are interested in</a></h1>
</div>
</body>
<!-- Late-loaded JavaScript -->
<script src="script/include-html.js"></script>
</html>
2 changes: 0 additions & 2 deletions capitello-dorico.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,4 @@ <h1><a href="index.html"> DORIC STYLE</a></h1>
<h1><a href="mailto:[email protected],[email protected]">Contact us if you are interested in</a></h1>
</div>
</body>
<!-- Late-loaded JavaScript -->
<script src="script/include-html.js"></script>
</html>
2 changes: 0 additions & 2 deletions capitello-ionico.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,4 @@ <h1><a href="mailto:[email protected],marchese.mattia@liceolioy.

</div>
</body>
<!-- Late-loaded JavaScript -->
<script src="script/include-html.js"></script>
</html>
7 changes: 6 additions & 1 deletion contacts.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@

<link rel="stylesheet" href="style/style.css">
<link rel="shortcut icon" href="images/instagram_icon.webp">
<style>
th {
user-select: none;
}
</style>
</head>
<body>
<nav>
Expand Down Expand Up @@ -68,6 +73,6 @@ <h1><pre>Contacts</pre></h1><hr>
</tbody>
</table>

<script src="script/include-html.js"></script>
<script src="script/script.js"></script>
</body>
</html>
2 changes: 0 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,5 @@ <h1><pre>Collector's Shop</pre></h1><hr>
</p>
<img src="images/ordini.jpg" alt="Ordini architettonici greci">
</div>

<script src="script/include-html.js"></script>
</body>
</html>
8 changes: 8 additions & 0 deletions script/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
function swapItems() { // Funzione che porta in cima l'ultimo elemento della tabella
table_rows = document.getElementsByTagName("tr"); // table_rows è l'elenco dei tag <tr>
table_rows[1].before(table_rows[table_rows.length - 1]); // Posiziona l'ultimo elemento di table_rows subito sopra il primo
}
// La variabile document si riferisce a tutto il DOM (Document Object Model)
button = document.getElementsByTagName("th")[0]; // button è il primo <th> della pagina, che corrisponde alla scritta "Social Media"
button.addEventListener("click", swapItems); // Aggiunge un listener (ascoltatore) per l'evento "click" relativo all'oggetto button
// In pratica chiama la funzione di callback che si chiama swapItems quando l'elemento button viene "click"ato

0 comments on commit d00d223

Please sign in to comment.