久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      <bdo id='4kSwi'></bdo><ul id='4kSwi'></ul>

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

    1. <legend id='4kSwi'><style id='4kSwi'><dir id='4kSwi'><q id='4kSwi'></q></dir></style></legend>
    2. <tfoot id='4kSwi'></tfoot>
    3. <small id='4kSwi'></small><noframes id='4kSwi'>

        jquery 為旋轉的 div 設置動畫

        jquery animate a rotating div(jquery 為旋轉的 div 設置動畫)
        <i id='KrORK'><tr id='KrORK'><dt id='KrORK'><q id='KrORK'><span id='KrORK'><b id='KrORK'><form id='KrORK'><ins id='KrORK'></ins><ul id='KrORK'></ul><sub id='KrORK'></sub></form><legend id='KrORK'></legend><bdo id='KrORK'><pre id='KrORK'><center id='KrORK'></center></pre></bdo></b><th id='KrORK'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='KrORK'><tfoot id='KrORK'></tfoot><dl id='KrORK'><fieldset id='KrORK'></fieldset></dl></div>

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

              <legend id='KrORK'><style id='KrORK'><dir id='KrORK'><q id='KrORK'></q></dir></style></legend>
                <tbody id='KrORK'></tbody>
              <tfoot id='KrORK'></tfoot>

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

                • 本文介紹了jquery 為旋轉的 div 設置動畫的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我想在動畫函數中旋轉一個 div,例如

                  I would like to rotate a div in an animate function such as

                   $('div').animate({rotate: '30deg'},1000);
                  

                  我找到了這個:

                  http://www.zachstronaut.com/posts/2009/08/07/jquery-animate-css-rotate-scale.html

                  但我想知道是否有更正式的方式來做到這一點,或者至少是不同的方式.

                  But I want to know if there is a more official way to do it or at least a different way.

                  謝謝

                  推薦答案

                  如果你愿意將 CSS3 與 jQuery 結合使用,也許這個方法對你有用:

                  If you're open to using CSS3 in combination with jQuery, perhaps this method may be of some use to you:

                  HTML

                  <div id="click-me">Rotate</div>
                  
                  <div id="rotate-box"></div>
                  

                  CSS

                  #rotate-box{
                  
                     width:50px;
                     height:50px;
                     background:#222222;
                  
                  }
                  
                  @-moz-keyframes rotatebox /*--for firefox--*/{
                  
                      from{
                          -moz-transform:rotate(0deg);
                      }       
                      to{
                          -moz-transform:rotate(360deg);
                      }                       
                  
                  }
                  
                  @-webkit-keyframes rotatebox /*--for webkit--*/{
                  
                      from{
                          -webkit-transform:rotate(0deg);
                      }       
                      to{
                          -webkit-transform:rotate(360deg);
                      }                       
                  
                  }
                  
                  #click-me{
                     font-size:12px;
                     cursor:pointer;
                     padding:5px;
                     background:#888888;
                  }
                  

                  假設有問題的元素應該在單擊鏈接/div/按鈕時旋轉,您的 jQuery 將如下所示:

                  And assuming that the element in question is supposed to rotate upon a click of a link/div/button, your jQuery will look something like this:

                  jQuery

                  $(document).ready(function(){
                      $('#click-me').click(function(){
                          $('#rotate-box').css({
                  
                          //for firefox
                          "-moz-animation-name":"rotatebox",
                          "-moz-animation-duration":"0.8s",
                          "-moz-animation-iteration-count":"1",
                              "-moz-animation-fill-mode":"forwards",
                  
                          //for safari & chrome
                          "-webkit-animation-name":"rotatebox",
                          "-webkit-animation-duration":"0.8s",
                          "-webkit-animation-iteration-count":"1",
                          "-webkit-animation-fill-mode" : "forwards",
                  
                          });
                      });
                  });
                  

                  因此,由于 jQuery 還不能在 .animate() 中支持 rotate(deg),所以我通過在 CSS3 中預定義動畫關鍵幀并為該特定動畫分配標簽或標識符有點作弊.在此示例中,該標簽/標識符定義為 rotatebox.

                  So since jQuery has yet to be able to support rotate(deg) in .animate(), I've kinda cheated by pre-defining the animation key frames in CSS3 and assigning a label or identifier to that particular animation. In this example, that label/identifier is defined as rotatebox.

                  從這里開始發生的事情是,當點擊可點擊的 div 時,jQuery 代碼片段將利用 .css() 并將必要的屬性分配給可旋轉元素.分配這些屬性的那一刻,將有一個從元素到 CSS3 動畫關鍵幀的橋梁,從而允許動畫執行.您還可以通過更改 animation-duration 屬性來控制動畫的速度.

                  What happens from here on is that the moment the clickable div is clicked upon, the jQuery snippet will utilize .css() and assign the necessary properties into the rotatable element. The moment those properties are assigned, there will be a bridge from the element to the CSS3 animation keyframes, thereby allowing for the animation to execute. You can also control the speed of the animation by altering the animation-duration property.

                  我個人認為只有在需要單擊或鼠標滾動事件來激活旋轉時才需要此方法.如果旋轉應該在文檔加載后立即運行,那么單獨使用 CSS3 就足夠了.如果懸停事件應該激活旋轉,這同樣適用 - 您只需在元素的偽類中定義將元素鏈接到旋轉動畫的 CSS3 動畫屬性.

                  I personally think that this method is only necessary if click or mouse scroll events are required to activate the rotate. If the rotate is supposed to be running immediately upon document load, then using CSS3 alone will suffice. The same applies to if a hover event is supposed to activate the rotate - you simply define the CSS3 animation properties that links the element to the rotating animation in the element's pseudo classes.

                  我的方法只是基于這樣的假設,即激活旋轉需要單擊事件,或者需要 jQuery 以某種方式參與其中.我知道這種方法非常乏味,所以如果有人有意見,請隨時提出建議.另請注意,由于此方法涉及 CSS3,因此在 IE8 及以下版本中無法正常工作.

                  My method here is simply based on the assumption that a click event is required to activate the rotate or that jQuery is somehow required to play a part in this. I understand that this method is pretty tedious so if anyone has a input, feel free to suggest. Do note also that as this method involves CSS3, it will not work as it should on IE8 and below.

                  這篇關于jquery 為旋轉的 div 設置動畫的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調用完成)
                  XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標頭) - IT屋-程序員軟件開發技術分
                  What is the difference between XMLHttpRequest, jQuery.ajax, jQuery.post, jQuery.get(XMLHttpRequest、jQuery.ajax、jQuery.post、jQuery.get 有什么區別)
                  Can onprogress functionality be added to jQuery.ajax() by using xhrFields?(可以使用 xhrFields 將 onprogress 功能添加到 jQuery.ajax() 嗎?)
                  Show a progress bar for downloading files using XHR2/AJAX(顯示使用 XHR2/AJAX 下載文件的進度條)
                  How can I open a JSON file in JavaScript without jQuery?(如何在沒有 jQuery 的情況下在 JavaScript 中打開 JSON 文件?)

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

                      <legend id='pCc4u'><style id='pCc4u'><dir id='pCc4u'><q id='pCc4u'></q></dir></style></legend>
                        <tfoot id='pCc4u'></tfoot>

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

                            <tbody id='pCc4u'></tbody>
                            <bdo id='pCc4u'></bdo><ul id='pCc4u'></ul>
                          • 主站蜘蛛池模板: 久久99国产精一区二区三区 | 亚欧精品| 玖玖综合在线 | 久久一区 | 亚洲欧美中文日韩在线v日本 | 亚洲欧洲中文日韩 | 久久99精品久久久久久国产越南 | 欧美色成人 | 最新国产精品视频 | 日韩视频精品在线 | 玖玖玖在线观看 | 九色视频网站 | 日韩一区二区三区在线播放 | 亚洲色图插插插 | 久久久久网站 | 国产乱码精品一区二区三区忘忧草 | 一区二区三区日本 | 国产高清av免费观看 | 亚洲精品视频在线 | 国产成人精品一区二区三区视频 | 毛片免费观看视频 | 中文字幕中文字幕 | 国产一区二区三区四区五区加勒比 | 成人在线视频观看 | 涩色视频在线观看 | av网站在线看 | 91福利影院 | 久久在线免费 | 伊人久久伊人 | 久久免费精品 | 色av一区| 91精品国产一区二区三区 | 国产亚洲精品久久午夜玫瑰园 | 国产午夜精品一区二区三区在线观看 | 日韩在线免费播放 | 亚洲国产精品区 | 伦理午夜电影免费观看 | 精品伊人久久 | 日韩欧美亚洲综合 | 一区二区三区免费 | 国产亚洲精品91 |