最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Fancybox 2 iframe not working correctly in IE - Stack Overflow

programmeradmin2浏览0评论

I'm having an issue with Fancybox 2.0 and Internet Explorer. It works fine on all other browsers.

In IE is like the lightbox div es on top of the iframe and I can't click any buttons.

Also the position in the page is different than on other browsers.

This are the parameters I'm using to call it

$('.fancybutton').fancybox({
        type      : 'iframe',
        maxWidth    : 800,
        maxHeight   : 600,
        fitToView   : true,
        width       : '70%',
        height      : '80%',
        autoSize    : false,
        closeClick  : false,
        openEffect  : 'none',
        closeEffect : 'none'
});

Any help would be very much appreciated

I'm opening the iframe with a normal link on an anchor tag

UPDATE

I added the DOCTYPE and the iframe is being opened fine in all browsers but... Inside this iframe i have a number of links, this works as a popup menu. The links are simple anchor tags, but when I click on the links in IE nothing happens. It works perfect on any other browsers :(

Cheers, Federico

I'm having an issue with Fancybox 2.0 and Internet Explorer. It works fine on all other browsers.

In IE is like the lightbox div es on top of the iframe and I can't click any buttons.

Also the position in the page is different than on other browsers.

This are the parameters I'm using to call it

$('.fancybutton').fancybox({
        type      : 'iframe',
        maxWidth    : 800,
        maxHeight   : 600,
        fitToView   : true,
        width       : '70%',
        height      : '80%',
        autoSize    : false,
        closeClick  : false,
        openEffect  : 'none',
        closeEffect : 'none'
});

Any help would be very much appreciated

I'm opening the iframe with a normal link on an anchor tag

UPDATE

I added the DOCTYPE and the iframe is being opened fine in all browsers but... Inside this iframe i have a number of links, this works as a popup menu. The links are simple anchor tags, but when I click on the links in IE nothing happens. It works perfect on any other browsers :(

Cheers, Federico

Share Improve this question edited Mar 6, 2012 at 11:52 Federico Giust asked Mar 5, 2012 at 10:57 Federico GiustFederico Giust 1,7934 gold badges22 silver badges48 bronze badges 4
  • 2 do you think we can see a link? it seems like there is nothing wrong with the code above but that says nothing. There a list of things you can start doing: check for javascript errors (IE is much more strict than other browsers); check you have a proper DOCTYPE (fancybox doesn't play well in IE quirks mode); check for CSS conflict issues (general CSS declarations like div {position: absolute} ... use specificity instead div#myDiv {position: absolute}), etc, etc, etc. – JFK Commented Mar 5, 2012 at 17:02
  • Thanks a lot for replying as it turns out it was the doctype !!! :) – Federico Giust Commented Mar 6, 2012 at 11:24
  • This is like a menu popup, but the submenus wont open in IE. I need to open them in the same iframe but it does nothing in IE 8 and it shows page not found in IE 9. :( – Federico Giust Commented Mar 6, 2012 at 11:53
  • 1 could you show a link then? ... also make sure that the page that opens in fancybox also has a correct DOCTYPE – JFK Commented Mar 6, 2012 at 17:42
Add a ment  | 

1 Answer 1

Reset to default 4

As it turns out I was missing the DOCTYPE as JFK suggested.

I added it at the top and it now works fine on all browsers

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3/TR/xhtml1/DTD/xhtml1-strict.dtd">

Thanks!

发布评论

评论列表(0)

  1. 暂无评论