我正在尝试创建一张 map ,其大小为 576 x 576。

它是由 32 x 32 的瓷砖创建的。所以我想要的是在这张 map 中找到我的 Angular 色 div 并给我一个 View 。就像无论我的 Angular 色位置在哪里,始终只显示它的 150 x 150 View 。就像游戏移动改变视线。我的 Angular 色总是保持在中心,并在他周围提供整个 576 x 576 div 的 150 x 150 View 。

.row {
    justify-content: center;
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
}

.texture img {
    width: 100%;
    height: auto;
    display: block;
}

.texture {
    position: relative;
}

.texture:hover {
    position: relative;
    filter: grayscale(1);
}

.char {
    position: absolute;
    z-index: 5;
    top: 0;
}
<div class="row">

<div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
<div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
<div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
<div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>

</div>

<div class="row">

<div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
<div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
<div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs">   <div class="char"><img src="https://i.ibb.co/8PZ6Dp9/hero-down.png" alt="hero"></div></div>
<div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>

</div>

<div class="row">

<div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
<div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
<div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
<div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>

</div>

<div class="row">

<div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
<div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
<div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
<div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>

</div>


这是一个 jsfiddle with a full-sized map

最佳答案

只需使用几个 div 并操纵中央的边距。

$("#up").on("click", function(e)
{
  var offset = parseInt($("#map").css("margin-top"));
  offset+=16;
  $("#map").css("margin-top", offset + "px");
});

$("#down").on("click", function(e)
{
  var offset = parseInt($("#map").css("margin-top"));
  offset-=16;
  $("#map").css("margin-top", offset + "px");
});

$("#left").on("click", function(e)
{
  var offset = parseInt($("#map").css("margin-left"));
  offset+=16;
  $("#map").css("margin-left", offset + "px");
});

$("#right").on("click", function(e)
{
  var offset = parseInt($("#map").css("margin-left"));
  offset-=16;
  $("#map").css("margin-left", offset + "px");
});
.row {
    justify-content: center;
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
}

.texture img {
    width: 100%;
    height: auto;
    display: block;
}

.texture:hover {
    position: relative;
    filter: grayscale(1);
}

button
{
  font-size: 20pt;width: 50px;height: 50px;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div style="float:right">
<table>
    <tr><td></td><td><button id="up">&uarr;</button><br /></td><td></td></tr>
    <tr><td><button id="left">&larr;</button><br /></td><td></td><td><button id="right">&rarr;</button><br /></td></tr>
    <tr><td></td><td><button id="down">&darr;</button><br /></td><td></td></tr>
</table>
</div>

<div id="viewport" style="width:300px;height:300px;overflow:hidden;position:relative;">
<img src="https://i.ibb.co/8PZ6Dp9/hero-down.png" alt="hero" style="position:absolute;left:140px;top:140px;">
<div id="map" style="width:590px; height:433px;">

<div class="row">
  <div class="texture"><img src="https://i.ibb.co/ZVsfZgZ/untitled3.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/4.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/1.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/ZVsfZgZ/untitled3.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
</div>
<div class="row">
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/4.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/ZVsfZgZ/untitled3.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/1.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
</div>

<div class="row">
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/4.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/1.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
</div>

<div class="row">
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/4.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/1.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
</div>

<div class="row">
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/4.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/1.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
</div>

<div class="row">
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/4.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/1.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
</div>

<div class="row">
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/4.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/1.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
</div>

<div class="row">
  <div class="texture"><img src="https://i.ibb.co/ZVsfZgZ/untitled3.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/4.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/1.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/ZVsfZgZ/untitled3.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
</div>
<div class="row">
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/4.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/ZVsfZgZ/untitled3.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/1.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
</div>

<div class="row">
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/4.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/1.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
</div>

<div class="row">
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/4.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/1.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
</div>

<div class="row">
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/4.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/1.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
</div>

<div class="row">
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/4.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/1.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
  <div class="texture"><img src="https://i.ibb.co/rpVFs8x/0.png" alt="bbs"></div>
</div>

</div>
</div>

关于javascript - 按元素位置显示大div的一小部分,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/57633285/

10-10 05:16