Tutti Frutti
This commit is contained in:
parent
3fceb2490a
commit
032d40ef47
@ -8,33 +8,23 @@ const swiper = new Swiper('.swiper', {
|
||||
});
|
||||
|
||||
// Für die Links in der Navbar, dass die Striche beim aktuell geklickten bleiben
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
var navLinks = document.querySelectorAll('.navbar .nav-link');
|
||||
var initialSelected = document.querySelector('.navbar .nav-link[aria-current="page"]');
|
||||
if (initialSelected) {
|
||||
var navLinks = document.querySelectorAll('.navbar .nav-link');
|
||||
var initialSelected = document.querySelector('.navbar .nav-link[aria-current="page"]');
|
||||
if (initialSelected) {
|
||||
initialSelected.classList.add('selected');
|
||||
}
|
||||
}
|
||||
|
||||
navLinks.forEach(function(link) {
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
// Alle anderen Links zurücksetzen
|
||||
navLinks.forEach(l => l.classList.remove('selected'));
|
||||
// Die 'selected' Klasse zum angeklickten Link hinzufügen
|
||||
link.classList.add('selected');
|
||||
});
|
||||
});
|
||||
});
|
||||
// Für Patenshop
|
||||
document.getElementById('donationForm').addEventListener('submit', function(event) {
|
||||
event.preventDefault();
|
||||
alert('Alles in Ordnung. Vielen Dank für Ihre Spende!');
|
||||
this.reset();
|
||||
});
|
||||
|
||||
// Für Preis
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
updatePrice();
|
||||
});
|
||||
updatePrice();
|
||||
|
||||
function updatePrice() {
|
||||
const fresserchenSelect = document.getElementById('Fresserchen');
|
||||
@ -50,4 +40,5 @@ function updatePrice() {
|
||||
function showDonationAmount() {
|
||||
const priceInput = document.getElementById('Preis').value;
|
||||
alert('Danke für deine Spende von €' + priceInput + '!');
|
||||
window.location.reload();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user