当IE 8中的大小改变(高度,宽度)时,VML中的可拖动元素会卡住 [英] Draggable element in VML get stuck when size change (height, width) in IE 8

查看:118
本文介绍了当IE 8中的大小改变(高度,宽度)时,VML中的可拖动元素会卡住的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了VML问题(我用svg作为后备)

I'm having issue with VML (wich I use as fallback for svg)

我使用jQuery UI draggable让用户能够移动元素。当我通过更改高度和宽度的样式属性来调整图像大小(即av:图像)时会出现问题。

I use jQuery UI draggable to let user be able to move an element around. The problem occurs when I resize the image (wich is a v:image) by changing the style attribute of height and width.

此时发生的是元素获取卡在它容器的左上角,不能再被拖动了。

What happen at this point is that the element get stuck at the left top corner of it's container and cannot be dragged anymore.

当我要求可拖动元素的位置(顶部,左侧)时,一个奇怪的事情是在javascript控制台中,我获得了价值,当我点击并拖动时这些值会发生变化 - 即使元素没有在视觉上移动......

A strange thing is that when I ask for the position (top, left) of the draggable element in the javascript console, I get value, and those values change when I click and drag - even though the element isn't visually moving...

任何人遇到这个之前的问题?

Anyone run into this problem before ?

这是我改变元素大小的地方。

Here's where I change then size of my element.

$($image)
    .css({
        'width' : zoomInPx_width + "px",
        'height' : zoomInPx_height + "px"
    });

可拖动的设置相当直接

$($image).draggable({
    drag: function () { /*callback here*/ }
})

谢谢!

推荐答案

最后我设法使这项工作。

Finaly I manage to make this work.

当我们改变可拖动元素的大小时,似乎VML在IE 8上崩溃。因此,我不得不销毁元素并在滑动时从头开始重新创建...

Seems that VML crash on IE 8 when we change size of a draggable element. So, I had to destroy the element and recreate it from scratch when sliding occurs...

这不是真正的高效,但这是我在这里工作的唯一修复方法。

That's not really performant, but that's the only fix to work for me up here.

顺便说一下,.detach()不起作用,你必须销毁它并从头开始重新创建它。

By the way, .detach() didn't work, you have to destroy it and recreate it from scratch.

您也可以获得一些信息: http://www.acumen-corp.com/Blog/tabid/298/EntryId/26/Using- jqueryRotate-ui-draggable-and-resizable-images-in-IE7-IE8-and-any-other-browser.aspx

You can get some info there too: http://www.acumen-corp.com/Blog/tabid/298/EntryId/26/Using-jqueryRotate-ui-draggable-and-resizable-images-in-IE7-IE8-and-any-other-browser.aspx

这篇关于当IE 8中的大小改变(高度,宽度)时,VML中的可拖动元素会卡住的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆