added fucntion to the close button
This commit is contained in:
parent
907183fab1
commit
a51c40fc48
@ -9,7 +9,8 @@
|
||||
<div><button onclick="upload()" type="submit" class="btn" id="upload_popup_sub">Zveřejnit</button></div>
|
||||
</div>
|
||||
<div id="image_popup">
|
||||
<img src="//:0">
|
||||
<img id="image_popup_img" src="//:0">
|
||||
<img id="close_btn" onclick="close_image()" src="./res/forum/images/close.png" alt="Tlačítko pro zavření obrázku">
|
||||
</div>
|
||||
<div id="posts"></div>
|
||||
|
||||
@ -96,7 +97,12 @@
|
||||
$(document).on("click", ".post_image", function(event)
|
||||
{
|
||||
$("#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());
|
||||
$("#image_popup").children("#image_popup_img").attr("src", $(this).children("img").attr("src"));
|
||||
$("#image_popup").children("#image_popup_img").attr("alt", $(this).parent(".post").children(".post_info").children("div").children(".post_name").html());
|
||||
});
|
||||
|
||||
function close_image()
|
||||
{
|
||||
$("#image_popup").css("display", "none");
|
||||
}
|
||||
</script>
|
Loading…
x
Reference in New Issue
Block a user