table th, table td {
padding: 10px;
text-align: center;
border-width: 1px;
border-style: solid;
vertical-align: middle;
}
table th, table td {
text-align: left;
}
table th, table td {
padding: 10px;
/*text-align: center;*/
border-width: 1px;
border-style: solid;
vertical-align: middle;
}
table th:nth-child(2), table td:nth-child(2),
table th:nth-child(4), table td:nth-child(4) {
text-align: left;
}
function setEqualHeight(columns) {
var tallestcolumn = 0;
columns.each(function () {
currentHeight = $(this).height();
if (currentHeight > tallestcolumn) {
tallestcolumn = currentHeight;
}
});
columns.height(tallestcolumn);
}
$(document).ready(function () {
setEqualHeight($(".columns > div.hdr"));
});
function setEqualHeight(columns) {
var tallestcolumn = 0;
columns.each(function (i, e) {
currentHeight = $(e).height();
if (currentHeight > tallestcolumn) {
tallestcolumn = currentHeight;
}
});
columns.each(function (i, e) {
if ($(e).hasClass("hdr")) {
$(e).height(tallestcolumn);
}
}
$(document).ready(function () {
setEqualHeight($(".columns > div"));
});
$(window).on('hashchange', function() {
window.location.hash = null;
});
$(window).on('hashchange', function() {
if (window.location.hash == '#') {
window.location.hash = null;
}
});
<div class="background">
<div class="triangle"></div>
</div>
* {
margin: 0;
padding: 0;
outline: 0 none;
box-sizing: border-box;
}
.background {
width: 100vw;
min-height: 100vh;
display: block;
overflow-x: hidden;
}
.triangle {
background: #404040;
height: 100vh;
display: block;
position: relative;
}
.triangle:after {
content: '';
position: absolute;
bottom: -15rem;
width: 0;
height: 0;
border: 1rem solid transparent;
background: transparent;
border-bottom: 14rem solid #404040;
transform: rotateX(180deg) scaleX(42);
left: 48.8%;
}
using (HttpClient client = new HttpClient())
{
var response = await client.GetAsync("https://api.vk.com/method?");
}
$(document).on("submit", "#your_form", function (e) {
var id = $("#your_form input[name='id']").val() >> 0;
var login = $("#your_form input[name='login']").val();
var request = {};
if (id > 0) {
request["id"] = id;
}
if (login) {
request["login"] = login;
}
$.post("/handler.php", request).done(function (response) {
if (response) {
alert(response);
return;
}
window.location.href = "/new/address/";
});
return false;
});
if (!isset($_POST["id"]) || !isset($_POST["login"])) {
echo "ID и логин обязательны для заполнения";
exit;
}
// Обработать $_POST["id"] и $_POST["login"], предусмотреть валидацию и экранирование спецсимволов
exit;
var blackCoeff = 1.25; // Коэффициент затемнения
var sectionList;
var blackList;
var counter;
function buildStyles() {
var styles = 'body {' +
'height: ' + ($("body").height() + 'px;') +
'position: relative;' +
'}' +
'.black {' +
'position: absolute;' +
'top: 0;' +
'left: 0;' +
'background: black;' +
'opacity: 0.8;' +
'}' +
'section {' +
'position: relative;' +
'top: 0;' +
'}' +
'section.fixed {' +
'position: fixed;' +
'top: 0;' +
'}';
$('head').append('<style id="sticky-stack-styles" type="text/css">' + styles + '</style>');
}
$(window).on('scroll', function() {
var windowScrollPos = $(window).scrollTop();
var tmpCounter = counter;
counter = 0;
for (var i = 0; i < sectionList.length; i++) {
if (windowScrollPos >= $(sectionList[i]).offset().top) {
counter++;
}
}
if (counter > 1) {
$(blackList[counter - 2]).css("opacity", (windowScrollPos / $(sectionList[counter < sectionList.length ? counter : counter - 1]).offset().top - 1) * (-counter * blackCoeff));
}
if (counter != tmpCounter) {
for (var i = 0; i < sectionList.length; i++) {
$(sectionList[i]).removeClass("fixed");
}
if ((tmpCounter == 2 && counter <= 1)) {
return;
}
$(sectionList[counter - 1]).addClass("fixed");
}
});
$(function () {
$("footer").append("<section/>");
sectionList = $("section");
for (var i = 0; i < sectionList.length; i++) {
var zIndex = (sectionList.length - i) * 2;
$(sectionList[i]).css("z-index", zIndex);
if (i == 0) {
continue;
}
$(sectionList[i]).prepend('<div class="black" style="width: ' + $(sectionList[i]).width() + 'px; height: ' + $(sectionList[i]).height() + 'px; z-index: ' + (zIndex + 1) + '"></div>');
}
blackList = $(".black");
buildStyles();
});