简体   繁体   English

Jquery ui旋转图像调整大小问题

[英]Jquery ui rotated image resize issue

I have an issue, I am using jquery ui resizable. 我有一个问题,我正在使用jquery ui resizable。 When I rotate the element in chrome, the controls get rotated too but when i resize the div with handles, they are inverted. 当我在chrome中旋转元素时,控件也会旋转,但是当我用手柄调整div的大小时,它们会被反转。 I mean if i am using sw control, it acts in weird way ie i move towards top and the image gets bigger while in actual it should get smaller. 我的意思是如果我使用sw控制,它以奇怪的方式行动,即我向顶部移动,图像变大,而在实际中它应该变小。 This is the problem with rotated divs only not the normal ones. 这是旋转的div只有不正常的问题。

Here is the js fiddle 这是js小提琴

http://jsfiddle.net/fahadnabbasi/2FLuf/11/ http://jsfiddle.net/fahadnabbasi/2FLuf/11/

You will see two images, one rotated and one normal. 您将看到两个图像,一个旋转,一个正常。 Normal works fine for resizing while rotated one resizes as well but in opposite direction. 正常可以调整大小,旋转调整大小也可以调整大小但方向相反。 Try to resize the rotated image from the bottom right control and you will see the problem. 尝试从右下角控件调整旋转图像的大小,您将看到问题。

I think you need jQuery UI Rotation http://vremenno.net/js/jquery-ui-rotation-using-css-transform/ (it's Russian). 我认为你需要jQuery UI Rotation http://vremenno.net/js/jquery-ui-rotation-using-css-transform/ (它是俄语)。 Here is a direct download: http://vremenno.net/examples/jquery-ui-rotation/jquery.ui.rotation.zip 这是一个直接下载: http//vremenno.net/examples/jquery-ui-rotation/jquery.ui.rotation.zip

Here is a fiddle I made up that implements the plugin: http://jsfiddle.net/MadLittleMods/4Vfm5/ 这是我制作的实现插件的小提琴: http//jsfiddle.net/MadLittleMods/4Vfm5/

After including the plugin just add. 包含插件后只需添加。 You can also add a parent div and apply it to that with .parent() : 您还可以添加父div并将其应用于.parent()

$('.resizable').rotatable();

Here is another topic that talks about rotating: jquery rotation plugin - that works like jquery ui resize 这是另一个讨论旋转的主题: jquery旋转插件 - 就像jquery ui resize一样

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM