This commit is contained in:
Nicolas Bally 2016-07-27 11:39:20 +02:00
parent 70a914007b
commit c24c2207eb
3 changed files with 22 additions and 6 deletions

View File

@ -14,7 +14,7 @@ $("document").ready ->
margintop = (( $(window).height() - imgheight) / 2 ) margintop = (( $(window).height() - imgheight) / 2 )
$("#large .large-img").css $("#large .img_container").css
"margin-top" :(margintop+"px") "margin-top" :(margintop+"px")
#"width" : "100px" #"width" : "100px"
@ -129,9 +129,9 @@ $("document").ready ->
$("#large").append "<img src='/arrow-next.png' class='next' />" $("#large").append "<img src='/arrow-next.png' class='next' />"
$("#large").append "<img src='/arrow-prev.png' class='prev' />" $("#large").append "<img src='/arrow-prev.png' class='prev' />"
$("#large").append "<img src='/close.png' class='close_link' />" #$("#large").append "<img src='/bouton-croix.png' class='close_link' />"
$("#large").append "<div class='img_container first'></div>" $("#large").append "<div class='img_container first'><div class='cross_container'><img src='/bouton-croix.png' class='close_link' /></div></div>"
$(".img_container.first").append "<img src="+$(this).attr("href")+" class='large-img' />" $(".img_container.first").append "<img src="+$(this).attr("href")+" class='large-img' />"
if $(this).attr "title" if $(this).attr "title"
@ -151,9 +151,15 @@ $("document").ready ->
if $(window).width() > (maxwidth+100) if $(window).width() > (maxwidth+100)
$("#large .large-img").css $("#large .large-img").css
"max-width" : maxwidth "max-width" : maxwidth
$("#large .cross_container").css
"max-width" : maxwidth
else else
$("#large .large-img").css $("#large .large-img").css
"max-width" : "85%" "max-width" : "85%"
$("#large .cross_container").css
"max-width" : "85%"
position_img(); position_img();

View File

@ -36,11 +36,20 @@
right:15px; right:15px;
} }
.cross_container{
margin:auto;
position:relative;
}
.close_link{ .close_link{
position:absolute; position:absolute;
top:10px; top:-20px;
left:10px; left:-20px;
width:40px; width:40px;
cursor:pointer;
} }

View File

@ -47,7 +47,8 @@ $blue :#2dadb1;
.close_popup{ .close_popup{
position:absolute; position:absolute;
top:-20px; top:-20px;
right:-20px; left:-20px;
width:40px;
cursor:pointer; cursor:pointer;
} }