开发者

$(window).load(function(){ is not working in iframe page in IE

I have the below code in my iframe page.

 $(window).load(function() {
    // No we can paint our canvas. Something rounded with a shadow ;-)
    $("#main-outer").liquidCanvas(

        "[shadow gradient{from:#000000; to:#ffffff;}] => roundedRect{radius:10}");
  }); 

when the parent page loads, the code inside iframe page not works. W开发者_运维问答hen i run the iframe page individually it works fine. I have this problem in IE only.

The problem is $(window).load(function(){ is not working in iframe page. How to fix this?

This liquid canvas plugin works with $(window).load(function()) and not with other functions


Apparently you're not the only one, there are a couple of comments on the load function's API page from people saying they have the same problem.

If you haven't already tried this, you might try a boring old-fashioned DOM0 event handler:

window.onload = function() {
    // No we can paint our canvas. Something rounded with a shadow ;-)
    $("#main-outer").liquidCanvas(
        "[shadow gradient{from:#000000; to:#ffffff;}] => roundedRect{radius:10}"
    );
};

...in case IE has some issue with its DOM2 mechanism. (They are somewhat separate mechanisms for various reasons.)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜