<div class="block-wrap">
<div class="block-img"></div>
<div class="block-text">
<h2>Заголовок</h2>
<p>Текст</p>
</div>
</div>
.block-wrap{
position: relative;
overflow: hidden;
}
.block-img{
position: relative;
width: 100%;
height: auto;
}
.block-text{
position: absolute;
top: 0;
left: 0;
background: rbga(0,0,0,.3);
color: #fff;
opacity: 0;
visibility: hidden;
width: 100%;
height: 100%;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding: 5%;
-webkit-transition: all 0.2s ease;
-moz-transition: all 0.2s ease;
-o-transition: all 0.2s ease;
-ms-transition: all 0.2s ease;
transition: all 0.2s ease;
}
.block-wrap:hover .block-text{
opacity: 0;
visibility: visible;
}
var img = new Image();
img.onload = function(){
document.getElementById("cont").appendChild(this);
}
img.src = '...';
$('#cont').click(function() {
var url = "http://pp.vk.me/c608129/v608129926/13d7/M78M4KmekWI.jpg",
that = $(this);
$.ajax({
type: "GET",
url: url,
dataType: "image/jpeg",
success: function(data) {
i = new Image();
i.src = url;
that.appned(i);
},
error: function(error, txtStatus) {
console.log(txtStatus);
console.log('error');
}
});
});
// /var/www/html/beta.site.com/settings.js
module.exports = {
domain: 'beta.site.js'
}
// /var/www/html/site.com/settings.js
module.exports = {
domain: 'site.js'
}
// app.js
var express = require('express');
var app = express();
// ...
app.listen(3000, require('./settings').domain)