pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

      <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="ru8jtyw" 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 為旋轉(zhuǎn)的 div 設(shè)置動畫

        jquery animate a rotating div(jquery 為旋轉(zhuǎn)的 div 設(shè)置動畫)
        <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="ojesra8" 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 為旋轉(zhuǎn)的 div 設(shè)置動畫的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我想在動畫函數(shù)中旋轉(zhuǎn)一個 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 結(jié)合使用,也許這個方法對你有用:

                  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;
                  }
                  

                  假設(shè)有問題的元素應(yīng)該在單擊鏈接/div/按鈕時旋轉(zhuǎn),您的 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 中預(yù)定義動畫關(guān)鍵幀并為該特定動畫分配標(biāo)簽或標(biāo)識符有點作弊.在此示例中,該標(biāo)簽/標(biāo)識符定義為 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.

                  從這里開始發(fā)生的事情是,當(dāng)點擊可點擊的 div 時,jQuery 代碼片段將利用 .css() 并將必要的屬性分配給可旋轉(zhuǎn)元素.分配這些屬性的那一刻,將有一個從元素到 CSS3 動畫關(guān)鍵幀的橋梁,從而允許動畫執(zhí)行.您還可以通過更改 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.

                  我個人認(rèn)為只有在需要單擊或鼠標(biāo)滾動事件來激活旋轉(zhuǎn)時才需要此方法.如果旋轉(zhuǎn)應(yīng)該在文檔加載后立即運行,那么單獨使用 CSS3 就足夠了.如果懸停事件應(yīng)該激活旋轉(zhuǎn),這同樣適用 - 您只需在元素的偽類中定義將元素鏈接到旋轉(zhuǎn)動畫的 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.

                  我的方法只是基于這樣的假設(shè),即激活旋轉(zhuǎn)需要單擊事件,或者需要 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.

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

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

                  相關(guān)文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調(diào)用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調(diào)用完成)
                  XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標(biāo)頭) - IT屋-程序員軟件開發(fā)技術(shù)分
                  What is the difference between XMLHttpRequest, jQuery.ajax, jQuery.post, jQuery.get(XMLHttpRequest、jQuery.ajax、jQuery.post、jQuery.get 有什么區(qū)別)
                  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 下載文件的進(jìn)度條)
                  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="7dytomd" 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>
                          • 主站蜘蛛池模板: 澳威全屋定制官网|极简衣柜十大品牌|衣柜加盟代理|全屋定制招商 百度爱采购运营研究社社群-店铺托管-爱采购代运营-良言多米网络公司 | 植筋胶-粘钢胶-碳纤维布-碳纤维板-环氧砂浆-加固材料生产厂家-上海巧力建筑科技有限公司 | 火锅加盟_四川成都火锅店加盟_中国火锅连锁品牌十强_朝天门火锅【官网】 | 免联考国际MBA_在职MBA报考条件/科目/排名-MBA信息网 | 黑龙江「京科脑康」医院-哈尔滨失眠医院_哈尔滨治疗抑郁症医院_哈尔滨精神心理医院 | 「银杏树」银杏树行情价格_银杏树种植_山东程锦园林 | 信阳网站建设专家-信阳时代网联-【信阳网站建设百度推广优质服务提供商】信阳网站建设|信阳网络公司|信阳网络营销推广 | 合肥抖音SEO网站优化-网站建设-网络推广营销公司-百度爱采购-安徽企匠科技 | 深圳公司注册-工商注册代理-注册公司流程和费用_护航财税 | 双能x射线骨密度检测仪_dxa骨密度仪_双能x线骨密度仪_品牌厂家【品源医疗】 | 天津市能谱科技有限公司-专业的红外光谱仪_红外测油仪_紫外测油仪_红外制样附件_傅里叶红外光谱技术生产服务厂商 | 冷油器-冷油器换管改造-连云港灵动列管式冷油器生产厂家 | NMRV减速机|铝合金减速机|蜗轮蜗杆减速机|NMRV减速机厂家-东莞市台机减速机有限公司 | 锯边机,自动锯边机,双面涂胶机-建业顺达机械有限公司 | 压力变送器-上海武锐自动化设备有限公司 | 有机肥设备生产制造厂家,BB掺混肥搅拌机、复合肥设备生产线,有机肥料全部加工设备多少钱,对辊挤压造粒机,有机肥造粒设备 -- 郑州程翔重工机械有限公司 | 包塑软管|金属软管|包塑金属软管-闵彬管业 | 电动打包机_气动打包机_钢带捆扎机_废纸打包机_手动捆扎机 | 预制舱-电力集装箱预制舱-模块化预制舱生产厂家-腾达电器设备 | 精密模具-双色注塑模具加工-深圳铭洋宇通 | 组织研磨机-高通量组织研磨仪-实验室多样品组织研磨机-东方天净 传递窗_超净|洁净工作台_高效过滤器-传递窗厂家广州梓净公司 | 气体检测仪-氢气检测仪-可燃气体传感器-恶臭电子鼻-深国安电子 | 泡沫消防车_水罐消防车_湖北江南专用特种汽车有限公司 | 上海公众号开发-公众号代运营公司-做公众号的公司企业服务商-咏熠软件 | 桑茶-七彩贝壳桑叶茶 长寿茶 | 废旧物资回收公司_广州废旧设备回收_报废设备物资回收-益美工厂设备回收公司 | 楼承板-钢筋楼承板-闭口楼承板-无锡优贝斯楼承板厂 | 电动手术床,医用护理床,led手术无影灯-曲阜明辉医疗设备有限公司 | 消泡剂_水处理消泡剂_切削液消泡剂_涂料消泡剂_有机硅消泡剂_广州中万新材料生产厂家 | 中开泵,中开泵厂家,双吸中开泵-山东博二泵业有限公司 | TPM咨询,精益生产管理,5S,6S现场管理培训_华谋咨询公司 | 馋嘴餐饮网_餐饮加盟店火爆好项目_餐饮连锁品牌加盟指南创业平台 | 恒温槽_恒温水槽_恒温水浴槽-上海方瑞仪器有限公司 | 工业雾炮机_超细雾炮_远程抑尘射雾器-世纪润德环保设备 | 机器视觉检测系统-视觉检测系统-机器视觉系统-ccd检测系统-视觉控制器-视控一体机 -海克易邦 | BESWICK球阀,BESWICK接头,BURKERT膜片阀,美国SEL继电器-东莞市广联自动化科技有限公司 | 双舌接地线-PC68数字式高阻计-ZC36|苏海百科 | 济南品牌设计-济南品牌策划-即合品牌策划设计-山东即合官网 | 英语词典_成语词典_日语词典_法语词典_在线词典网 | 拉力测试机|材料拉伸试验机|电子拉力机价格|万能试验机厂家|苏州皖仪实验仪器有限公司 | 蓝米云-专注于高性价比香港/美国VPS云服务器及海外公益型免费虚拟主机 |