CSSでトランジション・イージー・インを追加しました。コンテナ3内のユーザーがメニューをクリックすると、コンテナ2内の記事が表示され、表示されるとスムーズに上下に移動します。今のところ、他のタグはトランジション以外は完全にうまく動作します。どの部分を修正する必要がありますか?CSSトランジション・イン・アウトが機能しない
html {
overflow: scroll;
overflow-x: hidden;
}
::-webkit-scrollbar {
width: 0px; /* remove scrollbar space */
background: transparent; /* optional: just make scrollbar invisible */
}
/* optional: show position indicator in red */
::-webkit-scrollbar-thumb {
background: #FF0000;
}
#container1{
height: 100%;
width: 100%;
border: 1px solid green;
overflow: hidden;
}
#container2{
width: 70%;
height: 99%;
border: 1px solid blue;
overflow: auto;
float:right;
padding-right: 15px;
}
#container3{
width: 25%;
height: 99%;
border: 1px solid black;
overflow: auto;
float: left;
padding-right: 15px;
}
html, body{
height: 99%;
border: 1px solid red;
overflow: hidden;
}
/*responsive image*/
img {
width: 100%;
height: auto;
}
.panel{
width:100%;
height:100%;
z-index:0;
-webkit-transform: translateZ(0);
transform: translateZ(0);
-webkit-transition: -webkit-transform 0.9s ease-in-out;
transition: transform 0.9s ease-in-out;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
a[ id= "one" ]:target ~ #main article.panel {
-webkit-transform: translateY(0px);
transform: translateY(0px);
}
a[ id= "two" ]:target ~ #main article.panel {
-webkit-transform: translateY(-500px);
transform: translateY(-500px);
}
a[ id= "commerce" ]:target ~ #main article.panel {
-webkit-transform: translateY(-1000px);
transform: translateY(-1000px);
}
<div id="container1">
<div id="row">
<div id="container3">
<nav>
<ul>
<li><a href="#commerce">Commerce</a></li>
<li><a href="#one"> 1 </a> </li>
<li><a href="#two"> 2 </a> </li>
<li><a href="#two"> 2 </a> </li>
<li><a href="#two"> 2 </a> </li>
</ul>
</nav>
</div>
</div>
<div id="container2">
<article class="panel" id="one">
<h1> A bit of text here</h1>
</article>
<article class="panel" id="two">
<h1> More here :-)</h1>
</article>
<article class="panel" id="commerce"><img src = "http://plusquotes.com/images/quotes-img/roundflower.jpg" alt="breakfast"></article>
</div>
</div>
変換しないでください-webkit-transform –
cssでスクロールアニメーションを作成することはできません。ここでは、ページをスクロールするHTMLアンカーです。 JavaScriptまたはJQueryを使用します。 – Alexis