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

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

  3. <legend id='wdTTj'><style id='wdTTj'><dir id='wdTTj'><q id='wdTTj'></q></dir></style></legend>
      <bdo id='wdTTj'></bdo><ul id='wdTTj'></ul>

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

    1. jQuery - CSS - 通過拖動鼠標事件旋轉 Div

      jQuery - CSS - Rotate Div by drag mouse event(jQuery - CSS - 通過拖動鼠標事件旋轉 Div)
        <tbody id='3fEDo'></tbody>

      <legend id='3fEDo'><style id='3fEDo'><dir id='3fEDo'><q id='3fEDo'></q></dir></style></legend>
    2. <i id='3fEDo'><tr id='3fEDo'><dt id='3fEDo'><q id='3fEDo'><span id='3fEDo'><b id='3fEDo'><form id='3fEDo'><ins id='3fEDo'></ins><ul id='3fEDo'></ul><sub id='3fEDo'></sub></form><legend id='3fEDo'></legend><bdo id='3fEDo'><pre id='3fEDo'><center id='3fEDo'></center></pre></bdo></b><th id='3fEDo'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='3fEDo'><tfoot id='3fEDo'></tfoot><dl id='3fEDo'><fieldset id='3fEDo'></fieldset></dl></div>

            <small id='3fEDo'></small><noframes id='3fEDo'>

          1. <tfoot id='3fEDo'></tfoot>
                <bdo id='3fEDo'></bdo><ul id='3fEDo'></ul>
                本文介紹了jQuery - CSS - 通過拖動鼠標事件旋轉 Div的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我搜索了幾天沒有真正的結果,也許有人可以在這里幫助我.

                I'm searching since a few day without real result, maybe someone can help me here.

                我的頁面上有一個 div(可以包含圖像、文本區域等),它是可拖動且可調整大小的(感謝 jQuery UI),我想讓它可旋轉",并帶有一個句柄使用 css 變換 (-wekbit-transform, moz-transform) 拖動和旋轉角

                I've a div on my page (can containt an image, a text area, other), it's draggable and resizable (thanks to jQuery UI), and i want to make it "rotatable", with a handle in a corner to drag and rotate it using css transform (-wekbit-transform, moz-transform)

                有可能嗎?使用 jQuery 或其他 Javascript 嗎?

                Is it possible ? with jQuery or other Javascript ?

                其實我并不關心與 IE 的兼容性.

                Actually i don't care of compatibility with IE.

                提前致謝,問候

                推薦答案

                使用jQuery UI原有的拖動事件:

                Using jQuery UI's original drag events:

                $('selector').draggable({
                  drag: function(event, ui){
                    var rotateCSS = 'rotate(' + ui.position.left + 'deg)';
                
                    $(this).css({
                      '-moz-transform': rotateCSS,
                      '-webkit-transform': rotateCSS
                    });
                  }
                });
                

                問題是您的問題有點不清楚如何處理由此產生的兩種行為(當您拖動對象同時旋轉移動)的沖突.這個只是讓鼠標的左右移動來決定旋轉多少,而默認的拖動行為(移動)仍然存在.

                The problem is that your question is slightly unclear about how the conflict about the two behaviors (when you drag the object both rotates and moves around) that arise from this is handled. This one just let the left-right movement of the mouse determine how much to rotate, while the default drag behavior (movement) still exists.

                我想這有點駭人聽聞,但它會起作用:

                I suppose this is a little hackish but it will work:

                // Your original element
                var ele = $('#selector');
                
                // Create handle dynamically
                $('<div></div>').appendTo(ele).attr('id','handle').css({
                    'position': 'absolute',
                    'bottom': 5,
                    'right': 5,
                    'height': 10,
                    'width': 10,
                    'background-color': 'orange'
                });
                
                ele.css('position', 'relative');
                
                $('#handle').draggable({
                    handle: '#handle',
                    opacity: 0.01, 
                    helper: 'clone',
                    drag: function(event, ui){
                        var rotateCSS = 'rotate(' + ui.position.left + 'deg)';
                
                        $(this).parent().css({
                            '-moz-transform': rotateCSS,
                            '-webkit-transform': rotateCSS
                        });
                    }
                });
                

                這篇關于jQuery - CSS - 通過拖動鼠標事件旋轉 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 文件?)
                  <tbody id='0piUd'></tbody>

                  <small id='0piUd'></small><noframes id='0piUd'>

                    <bdo id='0piUd'></bdo><ul id='0piUd'></ul>

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

                          <legend id='0piUd'><style id='0piUd'><dir id='0piUd'><q id='0piUd'></q></dir></style></legend>
                          主站蜘蛛池模板: 亚洲成人av一区二区 | 久久久久久久一区二区三区 | 一级黄色毛片a | 国产一级片免费在线观看 | 欧美群妇大交群中文字幕 | 欧美一区二区在线 | 成人毛片视频在线播放 | 在线视频 亚洲 | 超碰精品在线观看 | 天天曰天天干 | 国产视频在线一区二区 | 婷婷中文字幕 | 国产露脸国语对白在线 | 午夜影院在线观看视频 | 99在线精品视频 | 午夜天堂精品久久久久 | 久久精品屋| 亚洲精品免费看 | 亚洲成人av在线 | 亚洲性视频网站 | 久久久看 | 四虎影院在线观看免费视频 | 国产 亚洲 网红 主播 | 久久久久久成人 | 日韩理论电影在线观看 | 日韩av免费在线电影 | 九九热在线视频 | 久久久久久国模大尺度人体 | 91网站在线观看视频 | 亚洲一区视频在线播放 | 成人av一区| 99免费看| 在线免费小视频 | 国产亚洲精品久久久久久豆腐 | 久久精品网 | 国产成人影院 | 成年人在线视频 | 久久精品国产一区二区电影 | 久亚州在线播放 | 欧美日韩亚洲视频 | 精品视频在线观看 |