简体   繁体   English

如何在jQuery中克隆两个功能?

[英]How to clone two functions in jquery?

I`ma new one in Jquery,so I have a prob with it. 我是Jquery中的新人,所以我有一个可能。

  var element = $(ui.draggable).clone();

this one works pretty fine ,but how can i add resizable function to it? 这个工作很好,但是我如何向它添加可调整大小的功能呢?

I'm guessing you are referring to the jQuery UI function (http://jqueryui.com/demos/resizable/), and if that's the case then you would simply write: 我猜您是在指jQuery UI函数(http://jqueryui.com/demos/resizable/),如果是这种情况,那么您只需编写:

element.resizable();

The above code would simply make the clone resizable. 上面的代码将使克隆的大小可调整。 But don't forget you still need to add it to the DOM to have the user see and interact with it. 但是不要忘记,您仍然需要将其添加到DOM中,以使用户看到并与之交互。

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

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