const someParams = {
src: 'https://habrastorage.org/r/w32/webt/5a/6c/29/5a6c29ca462dd577778903.png',
text: 'Lorem ipsum'
};
const someHtml = $(
'<div>' +
'<div class="one">' +
'<div class="two">' +
'<div class="three">'+
'<img src="' + someParams.src + '" class="four">'+
'<span class="five">' + someParams.text + '</span>'+
'</div>'+
'</div>'+
'</div>'+
'</div>'
);
$("#foo").append(someHtml);
const someParams = {
src: 'https://habrastorage.org/r/w32/webt/5a/6c/29/5a6c29ca462dd577778903.png',
text: 'Lorem ipsum'
};
const someHtml = $(
`<div>
<div class="one">
<div class="two">
<div class="three">
<img src="${someParams.src}" class="four">
<span class="five">${someParams.text}</span>
</div>
</div>
</div>
</div>`
);
$("#foo").append(someHtml);
e.target.textContent
/* Cookie function */
function getCookie(name) {
var matches = document.cookie.match(new RegExp(
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
));
return matches ? decodeURIComponent(matches[1]) : undefined;
}
if (getCookie('isVisited')) {
// меняем CSS
} else {
// Устанавливаем куки
document.cookie = 'isVisited=true; path=/';
}
console.log( pageYOffset);
console.log(a.top, a.left);
top – Y-координата верхней границы элемента,
left – X-координата левой границы,
right – X-координата правой границы,
bottom – Y-координата нижней границы.
<div class="message-wrapper">
<div class="message">
<h2>Test</h2>
</div>
</div>
.message-wrapper {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
background-color: rgba(0, 0, 0, 0.3);
z-index: 1;
}
.message {
background-color: #ffffff;
}
transform-style: preserve-3d;