Hello. Please tell me how you need to change the script so that you can work with the "if that" condition for the following function:
- jQuery -
$(document).ready(function(){ $('.photo li').waitForImages(function() { // Π€ΡΠ½ΠΊΡΠΈΡ, ΠΊΠΎΡΠΎΡΠ°Ρ ΡΠ»Π΅Π΄ΠΈΡ, Π·Π°Π³ΡΡΠ·ΠΈΠ»Π°ΡΡ Π»ΠΈ ΠΊΠ°ΡΡΠΈΠ½ΠΊΠ°. if($(this)){ $(this).show(); // Π΅ΡΠ»ΠΈ ΠΊΠ°ΡΡΠΈΠ½ΠΊΠ° Π½Π°ΠΉΠ΄Π΅Π½Π°, ΠΏΠΎΠΊΠ°Π·ΡΠ²Π°Π΅ΠΌ ΡΠ»Π΅ΠΌΠ΅Π½Ρ Ρ ΠΊΠ°ΡΡΠΈΠ½ΠΊΠΎΠΉ. }else{ $(this).remove(); // Π΅ΡΠ»ΠΈ Π½Π΅Ρ, ΡΠ΄Π°Π»ΡΠ΅ΠΌ ΡΠ»Π΅ΠΌΠ΅Π½Ρ. } }); }); - CSS -
.photo:nth-child(1) li:nth-child(1) {background: url("../img/cake.jpg") no-repeat;} - ΡΠ°ΠΊΠ°Ρ ΠΊΠ°ΡΡΠΈΠ½ΠΊΠ° Π΅ΡΡΡ. .photo:nth-child(2) li:nth-child(1) {background: url("../img/caked.jpg") no-repeat;} - ΡΠ°ΠΊΠΎΠΉ Π½Π΅Ρ. .photo:nth-child(3) li:nth-child(1) {background: url("../img/cakef.jpg") no-repeat;} - ΡΠ°ΠΊΠΎΠΉ Π½Π΅Ρ. .photo li { display: inline-block; border: 1px solid black; width: 270px; height: 200px; } - HTML -
<ul class="photo"> <li></li> </ul> <ul class="photo"> <li></li> </ul> <ul class="photo"> <li></li> </ul>