如何使用mootools创建浮动div?
我正在使用一个应用程序(IIPImage),它使用使用 mootools api 创建的脚本来显示高分辨率图像。我想在此页面中插入一个浮动窗口。最初我想使用jquery,但是我发现jquery不能与这个库共存,所以我需要使用mootools来创建这个浮动div。我怎样才能做到这一点?有人可以帮助我吗?
谢谢
I'm using an application (IIPImage) which display an High Resolution Image using a script created with mootools api. I want to insert a floating window in this page. Initially I think to use jquery, BUT I discover that jquery can't coexist with this library, so I need to use mootools to create this floating div. How I can do this? Someone can help me please?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
mootools 和 jquery 可以很好地共存,只要进行一些工作 - jquery 有一个
.noConflict()
模式,并且 mootools 不会接管 $ (自 1.2.2 起)如果它已经被定义并且将恢复使用document.id
代替。然而,IIPImage 似乎是为 1.2.0 编写的,它既旧又有问题,并且不关心覆盖 $ - 将 mootools 升级到 1.2.5 并在脚本中用 document.id( 替换 $( 的提及或添加一个闭包就像(function($) {
...来自缩放器的代码 ...})(document.id);
您可能需要找到任何全局变量引用并更改它们是从
var foo =
到window.foo =
声明的,但总而言之,对于其他解决方案来说,这不应该是一场戏剧,你可以弄清楚 。这里 http://davidwalsh.name/persistent-header-opacity
这是一小段代码启用位置:修复不支持它的浏览器(我认为8之前的IE)
玩得开心。
mootools and jquery can co-exist just fine, given some work - jquery has a
.noConflict()
mode and mootools won't take over $ (since 1.2.2) if it has already been defined and will revert to usingdocument.id
instead. however, IIPImage seems to have been written for 1.2.0 which is old and buggy and does not care about overwriting $ - upgrade mootools to 1.2.5 and replace mentions of $( with document.id( in the script or add a closure instead like(function($) {
... code from the zoomer ...})(document.id);
you may need to find any global vars refrences and change them as declared from
var foo =
towindow.foo =
but all in all, it should not really be a drama.as for the other solution, you can figure it out here http://davidwalsh.name/persistent-header-opacity
this is a small bit of code that enables position: fixed for browsers that don't support it (IE before 8 i think)
have fun.