showing big image on thumbnail click

This commit is contained in:
Václav Šmejkal 2024-05-25 14:26:48 +02:00
parent 65dca9d92e
commit d1439514a8
Signed by: ENGO150
GPG Key ID: 4A57E86482968843
2 changed files with 6 additions and 3 deletions

View File

@ -29,7 +29,7 @@
"</div>" +
"<div class=\"post_info\">" +
"<div>Název: " + result[i].title + "</div>" +
"<div>Název: <span class=\"post_name\">" + result[i].title + "</span></div>" +
"<div>Autor: " + result[i].username + "</div>" +
((result[i].description != null) ? "<div class=\"post_desc\">Popis: <div class=\"post_desc_text\">" + result[i].description + "</div></div>" : "") +
"</div>" +
@ -95,6 +95,8 @@
$(document).on("click", ".post_image", function(event)
{
console.log($(this).children("img").attr("src"));
$("#image_popup").css("display", "flex");
$("#image_popup").children("img").attr("src", $(this).children("img").attr("src"));
$("#image_popup").children("img").attr("alt", $(this).parent(".post").children(".post_info").children("div").children(".post_name").html());
});
</script>

View File

@ -311,7 +311,8 @@ body
border: solid 1px #3E392F;
border-radius: 0.5vh 0.5vh;
background-color: #555;
display: flex;
display: none;
justify-content: center;
}