如何使用 jquery 知道 iframe 已准备好...

发布于 2024-10-09 09:04:00 字数 793 浏览 0 评论 0原文

我正在使用 jquery 挤出机菜单(http://pupunzi.com/#mb.components/mb.extruder/extruder.html)。该菜单具有打开/关闭时的回调函数。我试图仅使用特定页面的回调函数来显示/隐藏 iframe 内的 div,除了 IE 之外,它工作正常。在 IE 中,它显示 jquery 文件错误。我希望问题出在 iframe 就绪状态。如果可以在 jquery 中得到它。我想它也可以在 ie 中工作..

var frame=$('#customer').contents();  

$("#extruderLeft").buildMbExtruder({
    position:"left",
    width:300,
    extruderOpacity:.9,
    hidePanelsOnClose:true,
    accordionPanels:true,
    onExtOpen:function(){
 frame.find("#atm_page").css("margin-left", "270px");
 frame.find('#tele').css("display", "none");
 }
   },
   onExtContentLoad:function(){},
   onExtClose:function(){
 frame.find("#atm_page").css("margin-left", "0px");
 frame.find("#tele").css("display", "block");
 }
   }
});

我过去两天尝试过这个。我希望我能从这里得到帮助。请帮帮我...

i am using jquery extruder menu (http://pupunzi.com/#mb.components/mb.extruder/extruder.html). That menu has callback functions on open/close. I am trying to show/hide a div inside the iframe using that callback functions for a particular page only, it work fine except IE. In IE it says the error with the jquery file. i hope the problem is with iframe ready state. if can get that in jquery. i think it will work in ie too..

var frame=$('#customer').contents();  

$("#extruderLeft").buildMbExtruder({
    position:"left",
    width:300,
    extruderOpacity:.9,
    hidePanelsOnClose:true,
    accordionPanels:true,
    onExtOpen:function(){
 frame.find("#atm_page").css("margin-left", "270px");
 frame.find('#tele').css("display", "none");
 }
   },
   onExtContentLoad:function(){},
   onExtClose:function(){
 frame.find("#atm_page").css("margin-left", "0px");
 frame.find("#tele").css("display", "block");
 }
   }
});

i trying this one past 2 days. i hope i can get help from here. plz help me out...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

﹏半生如梦愿梦如真 2024-10-16 09:04:00

你在那个 javascript 中有两个太多的右大括号,我想你想要更多这样的东西:

$('#extruderLeft').buildMbExtruder({
    position: 'left',
    width: 300,
    extruderOpacity: 0.9,
    hidePanelsOnClose: true,
    accordionPanels: true,
    onExtOpen: function() {
        frame.find('#atm_page').css('margin-left', '270px'); 
        frame.find('#tele').css('display', 'none');  
    },
    onExtContentLoad:function() {   
    },
    onExtClose:function() {
        frame.find('#atm_page').css('margin-left', '0px'); 
        frame.find('#tele').css('display', 'block');  
    }
});

IE 的 javascript 解释器在语法方面往往比大多数解释器更挑剔,例如臭名昭​​著的“额外的尾随逗号”问题。

You have two too many closing braces in that javascript, I think you want something more like this:

$('#extruderLeft').buildMbExtruder({
    position: 'left',
    width: 300,
    extruderOpacity: 0.9,
    hidePanelsOnClose: true,
    accordionPanels: true,
    onExtOpen: function() {
        frame.find('#atm_page').css('margin-left', '270px'); 
        frame.find('#tele').css('display', 'none');  
    },
    onExtContentLoad:function() {   
    },
    onExtClose:function() {
        frame.find('#atm_page').css('margin-left', '0px'); 
        frame.find('#tele').css('display', 'block');  
    }
});

IE's javascript interpreter tends to be pickier than most when it comes to syntax, the infamous "extra trailing comma" problem for example.

西瓜 2024-10-16 09:04:00

尝试

$('#customer').load(function() {
   // Your code here
});

-

$('#customer').load(function() {
    $('#extruderLeft').buildMbExtruder({
        position: 'left',
        width: 300,
        extruderOpacity: 0.9,
        hidePanelsOnClose: true,
        accordionPanels: true,
        onExtOpen: function() {
            frame.find('#atm_page').css('margin-left', '270px'); 
            frame.find('#tele').css('display', 'none');  
        },
        onExtContentLoad:function() {   
        },
        onExtClose:function() {
            frame.find('#atm_page').css('margin-left', '0px'); 
            frame.find('#tele').css('display', 'block');  
        }
    });
});

Try

$('#customer').load(function() {
   // Your code here
});

-

$('#customer').load(function() {
    $('#extruderLeft').buildMbExtruder({
        position: 'left',
        width: 300,
        extruderOpacity: 0.9,
        hidePanelsOnClose: true,
        accordionPanels: true,
        onExtOpen: function() {
            frame.find('#atm_page').css('margin-left', '270px'); 
            frame.find('#tele').css('display', 'none');  
        },
        onExtContentLoad:function() {   
        },
        onExtClose:function() {
            frame.find('#atm_page').css('margin-left', '0px'); 
            frame.find('#tele').css('display', 'block');  
        }
    });
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文