<legend id='vy7bn'><style id='vy7bn'><dir id='vy7bn'><q id='vy7bn'></q></dir></style></legend>

      • <bdo id='vy7bn'></bdo><ul id='vy7bn'></ul>

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

      <tfoot id='vy7bn'></tfoot>

    1. <small id='vy7bn'></small><noframes id='vy7bn'>

      使用 CSS3 旋转背景图像

      时间:2023-10-13

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

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

              <legend id='hcXmK'><style id='hcXmK'><dir id='hcXmK'><q id='hcXmK'></q></dir></style></legend>
                本文介绍了使用 CSS3 旋转背景图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我有一个背景图像,其中有一个指向右侧的箭头.当用户单击按钮时,选定状态会将箭头更改为向下(在我的图像精灵中使用不同的背景位置).

                I have a background image that has an arrow that points to the right. When a user clicks on the button, the selected state changes the arrow to point down (using a different background position in my image sprite).

                是否有使用 CSS3 对其进行动画处理的方法,所以一旦单击按钮并 jQuery 为其分配一个选定"类,它将在动画中从右到下旋转(仅 90 度)?(最好使用带有指向右侧的箭头的单个图像/位置)

                Is there anyway to animate this using CSS3 so once the button is clicked and jQuery assigns it a "selected" class, it will rotate in an animation (only 90 degrees) from the right to down? (preferably using the single image/position with the arrow that points to the right)

                我不确定是否需要使用变换或关键动画帧.

                I'm unsure as to whether transform or key animation frames need to be used.

                推荐答案

                你可以使用 ::after (或 ::before) 伪元素,生成动画

                you could use the ::after (or ::before) pseudo-element, to generate the animation

                div /*some irrelevant css */
                {
                    background:-webkit-linear-gradient(top,orange,orangered);
                    background:-moz-linear-gradient(top,orange,orangered);
                    float:left;padding:10px 20px;color:white;text-shadow:0 1px black;
                    font-size:20px;font-family:sans-serif;border:1px orangered solid;
                    border-radius:5px;cursor:pointer;
                }
                
                /* element to animate */
                div::after               /* you will use for example "a::after" */
                {
                    content:' ►';        /* instead of content you could use a bgimage here */
                    float:right;
                    margin:0 0 0 10px;
                    -moz-transition:0.5s all;
                    -webkit-transition:0.5s all;
                }
                
                /* actual animation */
                div:hover::after         /* you will use for example "a.selected::after" */
                {
                    -moz-transform:rotate(90deg);
                    -webkit-transform:rotate(90deg);
                }
                

                HTML:

                <div>Test button</div>
                

                在您的情况下,您将使用 element.selected 类而不是

                in your case you will use element.selected class instead of

                jsfiddle 演示:http://jsfiddle.net/p8kkf/

                希望对你有帮助

                这篇关于使用 CSS3 旋转背景图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:三个 JS 从 matrixWorld 获取(世界)旋转 下一篇:改变宽度/高度移动旋转的元素

                相关文章

                最新文章

                • <bdo id='cMn76'></bdo><ul id='cMn76'></ul>

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

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

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