var selectedId = localStorage.getItem('selectedId');
function setSelectId(id) {
$(".select")
.find("[value=" + selectedId + "]")
.prop("selected", true);
})
}
if (selectedId) {
setSelectId(selectedId);
}
$(".building").on("click", function () {
var id = $(this).attr("data-n");
localStorage.setItem('selectedId', id);
if (id !== selectedId) {
setSelectId(id);
}
});
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.19/lodash.min.js"></script>
const links = document.querySelectorAll('.link-add a[href]');
const url = 'http://test.ru/dwxl/?url='
Array.from(links)
.filter(link => link.getAttribute('href').startsWith('http'))
.forEach(link => link.href = url + link.href);
const links = document.querySelectorAll('.link-add a');
const url = 'http://test.ru/dwxl/?url='
Array.from(links)
.filter(link => link.getAttribute('href') && link.getAttribute('href').startsWith('http'))
.forEach(link => link.href = url + link.href);
aside {
white-space: nowrap;
}
aside {
display: flex;
width: 80%;
height: 110px;
margin: 10px 0px 30px 10%;
border: 1px ridge Grey;
border-radius: 15px;
overflow-x: scroll;
}
aside img {
height: 100px;
margin-top: 5px;
margin-left: 10px;
border-radius: 10px;
border: 1px solid DimGrey;
}
obj => !uniqIds[obj.id] && (uniqIds[obj.id] = true)
source.filter((obj) => {
console.log(obj.id);
//=> 'a'
// return !uniqIds[obj.id] && (uniqIds[obj.id] = true) - это тоже самое, что и
if (uniqIds[obj.id] !== 'undefined') { // if (uniqIds['a'] !== 'undefined') {
uniqIds[obj.id] = true; // uniqIds['a'] = true; => [{a: true}]
return true;
}
}
uniqIds = [
'a': true,
'b': true,
'c': true,
'd': true,
]
<table cellpadding="0" cellspacing="0" width="100%" background="img/pattern4.png" style="background-position: 10px center">
<table cellpadding="0" cellspacing="0" style="width:100%;background-image:url(img/pattern4.png);background-position: 10px center;">
<div class="d-flex justify-content-between bg-white mx-1 overflow-hidden" style="height: calc(100vh - 52px)">
<div class="d-flex justify-content-between bg-white mx-1" style="height: calc(100vh - 52px); overflow-y: auto;">
<style>
/* Media
======================*/
/* Intro*/
@media all and (max-width: 1200px) {
.intro__subtitle {
font-size: 8px;
}
}
</style>
<!-- Intro -->
<div class="intro" id="Intro">
<div class="container">
<div class="intro__inner">
<div class="intro__onas"></div>
<h2 class="intro__subtitle">ТЕКСТ ТЕКСТ</h2>
.container {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-column-gap: 30px;
grid-row-gap: 30px;
}
@media (max-width: 600px) {
.container {
grid-template-columns: 1fr 1fr;
}
}
.container {
display: flex;
flex-wrap: wrap;
}
.container::after {
content: '';
clear: both;
display: table;
}
.container__item {
...
float: left;
}
<html>
<head></head>
<body>
<head></head>
<div id="container">
...
</div>
</body>