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

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

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

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

        旋轉(zhuǎn)后調(diào)整div的寬度和高度

        Adjusting div width and height after rotated(旋轉(zhuǎn)后調(diào)整div的寬度和高度)

            • <legend id='WcVXN'><style id='WcVXN'><dir id='WcVXN'><q id='WcVXN'></q></dir></style></legend>

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

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

                  <tbody id='WcVXN'></tbody>
                <i id='WcVXN'><tr id='WcVXN'><dt id='WcVXN'><q id='WcVXN'><span id='WcVXN'><b id='WcVXN'><form id='WcVXN'><ins id='WcVXN'></ins><ul id='WcVXN'></ul><sub id='WcVXN'></sub></form><legend id='WcVXN'></legend><bdo id='WcVXN'><pre id='WcVXN'><center id='WcVXN'></center></pre></bdo></b><th id='WcVXN'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='WcVXN'><tfoot id='WcVXN'></tfoot><dl id='WcVXN'><fieldset id='WcVXN'></fieldset></dl></div>
                  <tfoot id='WcVXN'></tfoot>
                  本文介紹了旋轉(zhuǎn)后調(diào)整div的寬度和高度的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  如果我有這些規(guī)則:

                  <上一頁(yè)>寬度:50px;高度:100px;-moz 變換:旋轉(zhuǎn)(0 度)

                  然后一個(gè)事件將轉(zhuǎn)換更改為:

                  <上一頁(yè)>-moz 變換:旋轉(zhuǎn)(90 度)

                  從邏輯上講,這不應(yīng)該自動(dòng)交換寬度和高度嗎?我需要旋轉(zhuǎn)來(lái)切換寬度和高度以進(jìn)行準(zhǔn)確的位置檢測(cè).

                  謝謝,

                  解決方案

                  似乎轉(zhuǎn)換是在其他所有內(nèi)容之后應(yīng)用的,所以寬度和高度沒(méi)有更新.我能想到的最佳解決方案是使用旋轉(zhuǎn)矩陣自己計(jì)算旋轉(zhuǎn)尺寸:

                  [ cos X -sin X ] [ width ][ 罪 X cos X ] [ 高度 ]

                  將其轉(zhuǎn)換為 JavaScript 很簡(jiǎn)單.您需要旋轉(zhuǎn)所有四個(gè)角 (0,0) (w,0) (0,h) (w,h),然后旋轉(zhuǎn)的尺寸是旋轉(zhuǎn)邊界矩形的寬度和高度.

                  var angle = angle_in_degrees * Math.PI/180,sin = Math.sin(角度),cos = Math.cos(角度);//(0,0) 保持為 (0, 0)//(w,0) 旋轉(zhuǎn)var x1 = cos * 寬度,y1 = sin * 寬度;//(0,h) 旋轉(zhuǎn)var x2 = -sin * 高度,y2 = cos * 高度;//(w,h) 旋轉(zhuǎn)var x3 = cos * 寬度 - sin * 高度,y3 = sin * 寬度 + cos * 高度;var minX = Math.min(0, x1, x2, x3),maxX = Math.max(0, x1, x2, x3),minY = Math.min(0, y1, y2, y3),maxY = Math.max(0, y1, y2, y3);var rotateWidth = maxX - minX,旋轉(zhuǎn)高度 = maxY - minY;

                  If I have these rules:

                  width:50px;
                  height:100px;
                  -moz-transform: rotate(0deg)
                  

                  and then an event changes the transform to:

                  -moz-transform: rotate(90deg)
                  

                  logically, shouldn't that automatically exchange the width and the height? I need the rotate to switch width and height for accurate position detection.

                  Thanks,

                  Joe

                  解決方案

                  It seems like the transform is applied after everything else, so the width and height aren't updated. The best solution I can think of is to calculate the rotated dimensions yourself, using the rotation matrix:

                  [ cos X     -sin X ] [ width  ]
                  [ sin X      cos X ] [ height ]
                  

                  It's straightforward to translate this into JavaScript. You need to rotate all four corners (0,0) (w,0) (0,h) (w,h) and then the rotated dimensions are the width and height of the rotated bounding rectangle.

                  var angle = angle_in_degrees * Math.PI / 180,
                      sin   = Math.sin(angle),
                      cos   = Math.cos(angle);
                  
                  // (0,0) stays as (0, 0)
                  
                  // (w,0) rotation
                  var x1 = cos * width,
                      y1 = sin * width;
                  
                  // (0,h) rotation
                  var x2 = -sin * height,
                      y2 = cos * height;
                  
                  // (w,h) rotation
                  var x3 = cos * width - sin * height,
                      y3 = sin * width + cos * height;
                  
                  var minX = Math.min(0, x1, x2, x3),
                      maxX = Math.max(0, x1, x2, x3),
                      minY = Math.min(0, y1, y2, y3),
                      maxY = Math.max(0, y1, y2, y3);
                  
                  var rotatedWidth  = maxX - minX,
                      rotatedHeight = maxY - minY;
                  

                  這篇關(guān)于旋轉(zhuǎn)后調(diào)整div的寬度和高度的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  Selenium WebDriver get text from CSS property quot;contentquot; on a ::before pseudo element(Selenium WebDriver 從 CSS 屬性“內(nèi)容獲取文本在 ::before 偽元素上)
                  CSS Rotate Text Vertical - Extra Space on both sides(CSS垂直旋轉(zhuǎn)文本 - 兩側(cè)的額外空間)
                  Safari CSS Bug: Animation Rotation Direction Incorrect?(Safari CSS Bug:動(dòng)畫(huà)旋轉(zhuǎn)方向不正確?)
                  Rotating 90 degrees in CSS in IE8 and lower(在 IE8 及更低版本的 CSS 中旋轉(zhuǎn) 90 度)
                  How to calculate translate x and y value when resize after rotate..?(旋轉(zhuǎn)后調(diào)整大小時(shí)如何計(jì)算平移x和y值..?)
                  Flip div with two sides of html(用html的兩側(cè)翻轉(zhuǎn)div)
                1. <i id='6AqVV'><tr id='6AqVV'><dt id='6AqVV'><q id='6AqVV'><span id='6AqVV'><b id='6AqVV'><form id='6AqVV'><ins id='6AqVV'></ins><ul id='6AqVV'></ul><sub id='6AqVV'></sub></form><legend id='6AqVV'></legend><bdo id='6AqVV'><pre id='6AqVV'><center id='6AqVV'></center></pre></bdo></b><th id='6AqVV'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='6AqVV'><tfoot id='6AqVV'></tfoot><dl id='6AqVV'><fieldset id='6AqVV'></fieldset></dl></div>

                  • <bdo id='6AqVV'></bdo><ul id='6AqVV'></ul>

                      <tfoot id='6AqVV'></tfoot>

                        • <small id='6AqVV'></small><noframes id='6AqVV'>

                            <tbody id='6AqVV'></tbody>
                          <legend id='6AqVV'><style id='6AqVV'><dir id='6AqVV'><q id='6AqVV'></q></dir></style></legend>

                          • 主站蜘蛛池模板: 久久精品福利视频 | 亚洲国产成人精品女人久久久 | 成人一级毛片 | 狠狠草视频| 国产日韩欧美一区 | 一级毛片,一级毛片 | 欧美另类视频在线 | 精品欧美一区二区三区 | 青青操91 | 成人三区四区 | 亚洲一区二区三区四区在线观看 | 一本色道精品久久一区二区三区 | 国产伊人精品 | 国产精品视频网 | 成人国产在线观看 | 欧美性高潮 | 成人久久18免费网站图片 | 久久综合狠狠综合久久综合88 | 国产精品久久久久久一区二区三区 | 国产 日韩 欧美 在线 | 国产精品高清在线 | 99re6热在线精品视频播放 | 天堂网色 | 国产精品久久久久久久久图文区 | 亚洲人成人一区二区在线观看 | 成人av鲁丝片一区二区小说 | 黑人精品欧美一区二区蜜桃 | 欧洲亚洲精品久久久久 | 99久视频 | www.日韩系列 | 亚洲精品日韩一区二区电影 | 天天曰夜夜 | 成年无码av片在线 | 中国av在线免费观看 | 一区二区高清在线观看 | 欧美亚洲综合久久 | 91网在线观看 | 日韩毛片免费看 | 一区二区三区四区免费在线观看 | 国产精品日本一区二区不卡视频 | 一区二区三区视频 |