Hi there!
As announced in my previous posts, I implemented the Gray Out effect this week. The first step for that was to display the number of sponsorships for each child somewhere and somehow on the page, so that we have a basis to work with. I used an input field for that, where I set the hidden attribute and thanks to C# I could use the „@item.Sponsorships.Count“ statement to set the value attribute of the input field to the number of sponsorships. So now that I had a hidden input field with the number of sponsorships above every delete button I could worry about the JavaScript part. I could figure out quickly how to get the value of the input fields with JavaScript and the actual Gray out effekt was also not a problem, but I wanted to display the Gray Out effekt onload and not with an onClick event or something, so I asked an befriended developer from Germany for help, who really had a cool working function for that up his sleeve. After that I read something about website optimization and tried that on my JavaScript to relax a bit.