0
私は画像領域にマウスを移動する方法を検討しています(私の場合、画像はライブラリのサイトマップです)。その領域のコンテンツ領域が画像の下に表示されます。これまでは、画像を保持するdivを作成し、地図の各領域ごとにdivを作成しました。次に、情報を扱う独立したdivを作成しました。私は必要な領域に画像上の領域のdivを整列させることができましたが、コンテンツ情報を画像の下部に表示させるためにjqueryを理解することはできません。シンプルなjqueryのためのスニペット以下サイトマップの特定の領域にカーソルを移動すると、コンテンツ領域の下部にコンテンツ領域が表示される
.container {
position: relative;
text-align: center;
color: #000;
}
.container img {
width: 700px;
height: 400px;
}
.top-left {
position: absolute;
top: 200px;
left: 180px;
}
.top-right {
position: absolute;
top: 70px;
right: 220px;
}
.bottom-right {
position: absolute;
bottom: 100px;
right: 220px;
}
#left,
#topRight,
#centerRight,
#bottomRight {
display: none;
}
.centered {
position: absolute;
top: 50%;
left: 68%;
transform: translate(-50%, -50%);
}
<main>
<div class="container">
<img src="MelbournePublicLibraryFloorPlan.jpg" alt="Norway">
<div class="top-left">Top Left</div>
<div class="top-right">Top Right</div>
<div class="bottom-right">Bottom Right</div>
<div class="centered">Centered</div>
</div>
<div id="left">
<p>On the left of the library you will the book shelves.</p>
</div>
<div id="topRight">
<p>In the top right of the library you will find the computer desks.</p>
</div>
<div id="centerRight">
<p>In the center of the library on the right you will find the reading area. Make yourself comfortable and read a good book.</p>
</div>
<div id="bottomRight">
<p>
In the bottom right corner of the library you will find the service counters, were you will find friendly library staff
</p>
</div>
</main>
divクラスのコンテナ内のものをタイトルクラスに変更してから、個々のdiv内のものを変更しますかIDデータIDに? – Bec
はい、自分のコードと自分のコードを比較して理解を深めることができます。 –
こんにちは、あなたが言っていることとそれが動作していないことを完了しました。 – Bec