开发者

how to know iframe is ready for... using jquery

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,
    hideP开发者_运维技巧anelsOnClose: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...


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.


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');  
        }
    });
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜