-webkit-transform 旋转问题
好吧,我几乎查看了该网站上的所有轮换条目,但无法解决此问题。已经花了整整三天的时间试图弄清楚。这很可能是非常简单的事情,但我就是无法理解。问题是:我有 2 个具有旋转控件的图像。但是,当我旋转 1 时,它们都会旋转。我希望它们不要同时旋转,而是单独旋转。您可以在这里看到它: http://dl.dropbox.com/u/11770605/sample2 .html
这是 main.js 的以下代码:
$(document).ready(function(){ $('.cc-element').rotatable(); });
这是标记:
<span id="cc-element-1" class="cc-element ui-draggable cc-active" style="-webkit-transform: rotate(0deg);" ><image goes here></span>
我也尝试过:
$(document).ready(function(){
$('.cc-element').rotatable();
$('.cc-element2').rotatable();
});
但
<span id="cc-element-2" class="cc-element ui-draggable cc-active" style="-webkit-transform: rotate(0deg);" > <image goes here>< /span>
该修改不起作用。请帮助我,我必须尽快解决这个问题。
Ok, I've looked at virtually all of the rotation entries on this site and just cannot solve this. It has been 3 full days of trying to figure it out. More than likely it is something very simple but I just cannot get it. Here's the issue: I have 2 images that have rotate controls. However, when I go to rotate 1, they both rotate. I want them not to rotate simultaneously, but rather, on their own. You can see it here: http://dl.dropbox.com/u/11770605/sample2.html
Here's the following code for main.js:
$(document).ready(function(){ $('.cc-element').rotatable(); });
and here's the markup:
<span id="cc-element-1" class="cc-element ui-draggable cc-active" style="-webkit-transform: rotate(0deg);" ><image goes here></span>
I've also tried:
$(document).ready(function(){
$('.cc-element').rotatable();
$('.cc-element2').rotatable();
});
and
<span id="cc-element-2" class="cc-element ui-draggable cc-active" style="-webkit-transform: rotate(0deg);" > <image goes here>< /span>
but that modification did NOT work. Please, help me, I MUST get this fixed asap.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
问题是你的“rotatable()”插件对传递给它的
this
值进行操作,当你的选择器是“.cc-element”时,该值将是一个列表两个元素。因此,您对“roll()”插件的调用对整个列表进行操作。您需要将该插件中的适当代码包装在“each()”迭代器中。像这样的东西:
The problem is that your "rotatable()" plugin operates on the
this
value passed to it, which when your selector is ".cc-element" will be a list of both elements. Thus, your calls to the "roll()" plugin operate on the whole list.You need to wrap appropriate code in that plugin in an "each()" iterator. Something like:
您正在按类别选择元素,并且它们都具有相同的类别。像这样改变它:
you are selecting the elements by class and they both have the same class. Change it like this: