jQuery UI 对话框定位问题——“append”陈述问题
大家好——我在我的网站上使用 jQuery UI 对话框,但它使用绝对定位,而我需要相对定位。我的解决方案是将动态创建的 DIV 包装在相对定位的元素中。
我找到了需要更改的代码行,但我认为我的更改正在影响“容器”变量并破坏了代码的其余部分。有谁知道更改此设置的最佳方法:
function initialize(instance) {
_this = instance;
// build html
var realCaller = caller != null? caller:$("body");
var cornerClass = options.showRoundCorner? "ui-corner-all ":"";
realCaller.append("<div id='"+windowId+"' class='window_panel "+cornerClass+options.containerClass+"'></div>");
container = realCaller.children("div#"+windowId);
在“append”行上添加“
”,如下所示: function initialize(instance) {
_this = instance;
// build html
var realCaller = caller != null? caller:$("body");
var cornerClass = options.showRoundCorner? "ui-corner-all ":"";
realCaller.append("<div class=window_container><div id='"+windowId+"' class='window_panel "+cornerClass+options.containerClass+"'></div></div>");
container = realCaller.children("div#"+windowId);
我不知道为什么它会破坏其余部分脚本,但我认为这与 JS 其余部分创建和引用“容器”的方式有关。
现在已经为此工作了 8 个多小时..任何人都可以帮忙!?
如有必要,我可以提供更多详细信息。
干杯!
Hey Guys -- I'm using a jQuery UI dialog box on my site but it's using absolute positioning and I need relative. My solution is to wrap the dynamically created DIV in a relatively positioned element.
I found the line of code I need to change but I think my change is affecting the "container" variable and breaking the remainder of the code. Does anyone know the best way to change this:
function initialize(instance) {
_this = instance;
// build html
var realCaller = caller != null? caller:$("body");
var cornerClass = options.showRoundCorner? "ui-corner-all ":"";
realCaller.append("<div id='"+windowId+"' class='window_panel "+cornerClass+options.containerClass+"'></div>");
container = realCaller.children("div#"+windowId);
to add "<div class=window_container>
" on the "append" line, like this:
function initialize(instance) {
_this = instance;
// build html
var realCaller = caller != null? caller:$("body");
var cornerClass = options.showRoundCorner? "ui-corner-all ":"";
realCaller.append("<div class=window_container><div id='"+windowId+"' class='window_panel "+cornerClass+options.containerClass+"'></div></div>");
container = realCaller.children("div#"+windowId);
I don't know why it's breaking the rest of the script but I assume it's something to do with the way the "container" is being created and referenced by the rest of the JS.
Been working on this for over 8 hours now.. anyone can help!?
I can provide more details if necessary.
Cheers!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论