У меня есть несколько домов в правом div, и у меня есть карта с левой стороны, и я хочу создать что-то вроде адресов ниже: https://www.hometogo.com/search/5460aea1318a0?campaign=widget/all/a/wimdu/5460aea1318a0&w-message=1&persons=2&arrival=2018-10-10&duration=9
Я хочу, чтобы моя карта была зафиксирована, как верхняя ссылка, и чтобы можно было видеть больше домов с помощью прокрутки и я не хочу, чтобы div с классом showResultSearch имел прокрутку. как я могу это сделать?
var locations = [
['Bondi Beach', -33.890542, 151.274856, 4],
['Coogee Beach', -33.923036, 151.259052, 5],
['Cronulla Beach', -34.028249, 151.157507, 3],
['Manly Beach', -33.80010128657071, 151.28747820854187, 2],
['Maroubra Beach', -33.950198, 151.259302, 1]
];
var map = new google.maps.Map(document.getElementById('searchMap'), {
zoom: 10,
center: new google.maps.LatLng(-33.92, 151.25),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var infowindow = new google.maps.InfoWindow();
var marker, i;
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
map: map
});
google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
infowindow.setContent(locations[i][0]);
infowindow.open(map, marker);
}
})(marker, i));
}.searchContainer {
overflow: hidden;
position: relative;
}
.searchResults {
width: 60%;
float: right;
border-top: 1px solid #eee;
}
.showResultSearch {
clear: both;
border-top: 1px solid #eee;
padding-right: 30px;
padding-left: 30px;
margin-left: auto;
margin-right: auto;
max-height: 600px;
overflow-y: auto;
}
.searchMap {
border: 1px solid lightgray;
float: right;
width: 40%;
height: 600px;
}
#searchMap {
width: 100%;
height: 100%;
}
.row {
margin-left: -15px;
margin-right: -15px;
}
.col-sm-6 {
padding-left: 15px;
padding-right: 15px;
width: 50%;
float: right;
}
.specialOffer {
width: 100%;
}<header></header>
<div class = "searchContainer">
<div class = "searchResults">
<div class = "showResultSearch">
<div class = "row" id = "houses">
<div class = "col-sm-6">
<figure class = "specialOffer">
<a href = "#" class = "images">
<img src = "Images/house1.jpg" />
</a>
<figcaption>
<div class = "title-house">
<a href = "#" class = "house-name">
<h3>house1 </h3>
</a>
</div>
</figcaption>
</figure>
</div>
<div class = "col-sm-6">
<figure class = "specialOffer">
<a href = "#" class = "images">
<img src = "Images/house2.jpg" />
</a>
<figcaption>
<div class = "title-house">
<a href = "#" class = "house-name">
<h3>house2 </h3>
</a>
</div>
</figcaption>
</figure>
</div>
<div class = "col-sm-6">
<figure class = "specialOffer">
<a href = "#" class = "images">
<img src = "Images/house1.jpg" />
</a>
<figcaption>
<div class = "title-house">
<a href = "#" class = "house-name">
<h3>house3 </h3>
</a>
</div>
</figcaption>
</figure>
</div>
<div class = "col-sm-6">
<figure class = "specialOffer">
<a href = "#" class = "images">
<img src = "Images/house1.jpg" />
</a>
<figcaption>
<div class = "title-house">
<a href = "#" class = "house-name">
<h3>house4 </h3>
</a>
</div>
</figcaption>
</figure>
</div>
</div>
</div>
</div>
<div class = "searchMap">
<div id = "searchMap"></div>
</div>
</div>
<footer>
</footer>


![Безумие обратных вызовов в javascript [JS]](https://i.imgur.com/WsjO6zJb.png)


Выбросьте position: relative из .searchContainer и добавьте display: flex.
Установить позицию: зафиксировано на #searchMap
Работает нормально, насколько я понимаю ваш вопрос. Что касается полос прокрутки, попробуйте работать с переполнениями (переполнение: скрыто) или с шириной и высотой.
не могли бы вы обновить свою скрипку, я думаю, что она не работает.