是否可以在两个 JQuery 插件之间传递数据?
我有两个自己的 jquery 插件,这两个插件创建的元素有自己的 z-index 值。例如:
// auto increase the z-index value
// auto increase the z-index to the maximum of their own when I drag it.
element1 created by plugin1 and has the z-index:1;
element2 created by plugin1 and has the z-index:2;
....
// auto increase the z-index value
// auto increase the z-index to the maximum of their own when I drag it.
element2 created by plugin2 and has the z-index:1;
element2 created by plugin2 and has the z-index:2;
.....
并且它们都可以可拖动,所以当我点击其中一个时,我希望它的 z-index 值成为我创建的所有元素的最大值。但是现在 z-index 分开了!
我正在使用 JQuery UI 可拖动插件,但不喜欢堆栈选项!
非常感谢!!
I have two jquery plugin of my own and the elements created by the two plugin had its own z-index value.E.g:
// auto increase the z-index value
// auto increase the z-index to the maximum of their own when I drag it.
element1 created by plugin1 and has the z-index:1;
element2 created by plugin1 and has the z-index:2;
....
// auto increase the z-index value
// auto increase the z-index to the maximum of their own when I drag it.
element2 created by plugin2 and has the z-index:1;
element2 created by plugin2 and has the z-index:2;
.....
and both of them can be draggable,so when I click one of them I want its z-index value to be the maximum of all the elements I created.But now the z-index were separated!
I am using JQuery UI draggable plugin but don't like the stack option !
Thank you very much!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用名称空间
尝试在插件 1 中
你可以定义
这个可以在js的任何部分检索
但请确保其在 document.ready 之前定义
Try using name spaces
for eg in plugin 1
you can define
This can be retrieved in any part of the js
but make sure its defined before document.ready