<tfoot id='8PVls'></tfoot>
  • <legend id='8PVls'><style id='8PVls'><dir id='8PVls'><q id='8PVls'></q></dir></style></legend>

    <small id='8PVls'></small><noframes id='8PVls'>

    <i id='8PVls'><tr id='8PVls'><dt id='8PVls'><q id='8PVls'><span id='8PVls'><b id='8PVls'><form id='8PVls'><ins id='8PVls'></ins><ul id='8PVls'></ul><sub id='8PVls'></sub></form><legend id='8PVls'></legend><bdo id='8PVls'><pre id='8PVls'><center id='8PVls'></center></pre></bdo></b><th id='8PVls'></th></span></q></dt></tr></i><div id='8PVls'><tfoot id='8PVls'></tfoot><dl id='8PVls'><fieldset id='8PVls'></fieldset></dl></div>

        • <bdo id='8PVls'></bdo><ul id='8PVls'></ul>

        用html的两侧翻转div

        时间:2023-10-13
        <i id='cDqtT'><tr id='cDqtT'><dt id='cDqtT'><q id='cDqtT'><span id='cDqtT'><b id='cDqtT'><form id='cDqtT'><ins id='cDqtT'></ins><ul id='cDqtT'></ul><sub id='cDqtT'></sub></form><legend id='cDqtT'></legend><bdo id='cDqtT'><pre id='cDqtT'><center id='cDqtT'></center></pre></bdo></b><th id='cDqtT'></th></span></q></dt></tr></i><div id='cDqtT'><tfoot id='cDqtT'></tfoot><dl id='cDqtT'><fieldset id='cDqtT'></fieldset></dl></div>
          • <bdo id='cDqtT'></bdo><ul id='cDqtT'></ul>

              <small id='cDqtT'></small><noframes id='cDqtT'>

              <tfoot id='cDqtT'></tfoot>
                    <tbody id='cDqtT'></tbody>

                  <legend id='cDqtT'><style id='cDqtT'><dir id='cDqtT'><q id='cDqtT'></q></dir></style></legend>
                1. 本文介绍了用html的两侧翻转div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我在当前正在构建的网站上有一个登录表单,我也有一个注册表单.当单击注册"链接时,我想通过将 div 旋转到另一侧来添加一些精美的动画.我希望登录表单位于正面,而注册表单位于背面.我宁愿不使用 javascript,但如果有必要,我会.

                  I have a login form on a site I am currently building, and I also have a signup form. I would like to add some fancy animation to it by rotating the div to the other side when the "Sign up" link is clicked. I want the login form to be on the front side, and the signup form on the back. I would rather not use javascript, but if necessary, I will.

                  感谢您提供任何可能的答案!

                  Thanks for any possible answers!

                  推荐答案

                  您可以使用 CSS transitiontransform: rotateY() 来制作动画,无需 Javascript,其他而不是通过添加一个类来触发动画.

                  You can do the animation using CSS transition and transform: rotateY() with no Javascript, other than triggering the animation by adding a class.

                  演示:http://jsfiddle.net/ThinkingStiff/9UMFg/

                  CSS:

                  .flip {
                      backface-visibility: hidden;
                      border: 1px solid black;
                      height: 150px;
                      position: absolute;
                      transform-origin: 50% 50% 0px;
                      transition: all 3s;
                      width: 300px;    
                  }
                  
                  #side-1 {
                      transform: rotateY( 0deg );
                  }
                  
                  #side-2 {
                      transform: rotateY( 180deg );   
                  }
                  
                  .flip-side-1 {    
                      transform: rotateY( 0deg ) !important;
                  }
                  
                  .flip-side-2 {
                      transform: rotateY( 180deg ) !important;
                  }
                  

                  HTML:

                  <form id="side-1" class="flip">
                      <div>login</div>
                      <input id="username" placeholder="enter username" />
                      <input id="password" placeholder="enter password" />
                      <a id="login" href="#">login</a>
                      <a id="signup" href="#">sign up</a>
                  </form>
                  <form id="side-2" class="flip">
                      <div>signup</div>
                      <input id="new-username" placeholder="enter username" />
                      <input id="new-password" placeholder="enter password" />
                      <input id="new-re-password" placeholder="re-enter password" />
                      <a id="create" href="#">create</a>
                  </form>
                  

                  脚本:

                  document.getElementById( 'signup' ).addEventListener( 'click', function( event ) {
                  
                      event.preventDefault();
                      document.getElementById( 'side-2' ).className = 'flip flip-side-1';
                      document.getElementById( 'side-1' ).className = 'flip flip-side-2';
                  
                  }, false );
                  

                  这篇关于用html的两侧翻转div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:IE8 CSS 旋转 下一篇:如何旋转 HTML5 画布的现有内容?

                  相关文章

                  最新文章

                2. <legend id='Vnd6t'><style id='Vnd6t'><dir id='Vnd6t'><q id='Vnd6t'></q></dir></style></legend>

                  <small id='Vnd6t'></small><noframes id='Vnd6t'>

                  <tfoot id='Vnd6t'></tfoot>
                    <bdo id='Vnd6t'></bdo><ul id='Vnd6t'></ul>
                  <i id='Vnd6t'><tr id='Vnd6t'><dt id='Vnd6t'><q id='Vnd6t'><span id='Vnd6t'><b id='Vnd6t'><form id='Vnd6t'><ins id='Vnd6t'></ins><ul id='Vnd6t'></ul><sub id='Vnd6t'></sub></form><legend id='Vnd6t'></legend><bdo id='Vnd6t'><pre id='Vnd6t'><center id='Vnd6t'></center></pre></bdo></b><th id='Vnd6t'></th></span></q></dt></tr></i><div id='Vnd6t'><tfoot id='Vnd6t'></tfoot><dl id='Vnd6t'><fieldset id='Vnd6t'></fieldset></dl></div>