File tree 2 files changed +33
-0
lines changed
2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -58,3 +58,20 @@ <h4 class="post-title">{{ post.title }}</h4>
58
58
</ a >
59
59
</ div >
60
60
{% endfor %} {% endif %}
61
+ < div id ="overlay "> </ div >
62
+ < script src ="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js "> </ script >
63
+ < script type ="text/javascript ">
64
+ $overlay = $ ( '#overlay' ) ;
65
+
66
+ $ ( 'img' ) . click ( function ( ) {
67
+ $overlay . fadeTo ( 200 , 1 ) . css ( {
68
+ backgroundImage : 'url(' + this . src + ')' ,
69
+ backgroundSize : 'contain'
70
+ } ) ;
71
+ } ) ;
72
+ $overlay . click ( function ( ) {
73
+ $ ( this ) . stop ( ) . fadeTo ( 200 , 0 , function ( ) {
74
+ $ ( this ) . hide ( ) ;
75
+ } ) ;
76
+ } ) ;
77
+ </ script >
Original file line number Diff line number Diff line change 46
46
.related-post-title {
47
47
border-bottom : thin solid #f3f3f3 ;
48
48
}
49
+
50
+ #overlay {
51
+ display :none ;
52
+ position :fixed ;
53
+ top :0 ;
54
+ left : 0 ;
55
+ width :100% ;
56
+ height :100% ;
57
+ background-color :rgba (0 ,0 ,0 ,0.4 );
58
+ background-repeat :no-repeat ;
59
+ background-position : center center ;
60
+ cursor :pointer ;
61
+ }
62
+ .post-content img {
63
+ cursor : pointer ;
64
+ }
You can’t perform that action at this time.
0 commit comments