私はレイアウトとしてヘッダといくつかの画像をコンテンツとして持っています。画像をクリックすると、画面に合わせて拡大表示されます。 jQueryとJSは公正なゲームです。ここに私が何を持っている、私はちょうどそれがposition
の変更のために移行で動作するように得ることができません。またヘッダーをカバーする必要があります。トップ `追加ヘッダの上に配置する画像をクリックして塗りつぶす
$(document).ready(function() {
$("main img").click(function() {
$(this).toggleClass("click");
});
});
html, body {
height:100%;
margin:0;
padding:0;
}
header {
height:25%;
width:100%;
background-color:blue;
}
main {
display:flex;
justify-content:space-around;
flex-wrap:wrap;
}
main img {
padding:1em;
transition:1s;
}
main img.click {
position:absolute;
width:100%;
height:auto;
padding:0;
transition:1s;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<header>
</header>
<main>
<img src="https://placehold.it/100x100">
<img src="https://placehold.it/100x100">
<img src="https://placehold.it/100x100">
<img src="https://placehold.it/100x100">
<img src="https://placehold.it/100x100">
<img src="https://placehold.it/100x100">
<img src="https://placehold.it/100x100">
<img src="https://placehold.it/100x100">
</main>
:0;'画像のための 'css'います。 – NewToJS