2013-05-28 151 views
0

我写了一个脚本,点击jquery加载html到当前页面。但是,这对所有的浏览器,但IE 7的罚款,我非常困惑,为什么这可能是。这些按钮是页面右上角的信息和联系人按钮。Popup Jquery在所有浏览器中都能正常工作,但IE7

http://madaxedesign.co.uk/

的Jquery:

$(document).ready(function() { 


// INFORMATION PAGE 


$('a.info , a.info_footer').click(function() { 
    $("html, body").animate({ scrollTop: 0 }, 600); 
    $("#popup").load("/info.html"); 
    // Getting the variable's value from a link 
    var 
    show = $('#popup').css('display', 'block'), 
    popup = $(this).attr('href'); 

    //Fade in the Popup and add close button 
    $(popup).fadeIn(300); 

    //Set the center alignment padding + border 
    var popMargTop = ($(popup).height() + 24)/2; 
    var popMargLeft = ($(popup).width() + 24)/2; 

    $(popup).css({ 
     'margin-top' : -popMargTop, 
     'margin-left' : -popMargLeft 
    }); 

    // Add the mask to body 
    $('body').append('<div id="mask"></div>'); 
    $('#mask').fadeIn(300); 

    return false; 
}); 

// When clicking on the button close or the mask layer the popup closed 
$('#popup').on('click', '.cross', function() { 
    $('#mask , #popup').fadeOut(300 , function() { 
    $('#mask').remove(); 
}); 
return false; 
}); 


    // CONTACT FORM PAGE 


    $('a.contact , a.contact_footer, a.contact_text').click(function() { 
    $("html, body").animate({ scrollTop: 0 }, 600); 
    $("#popup").load("/contact.php"); 
    // Getting the variable's value from a link 
    var 
    show = $('#popup').css('display', 'block'), 
    popup = $(this).attr('href'); 

    //Fade in the Popup and add close button 
    $(popup).fadeIn(300); 

    // Add the mask to body 
    $('body').append('<div id="mask"></div>'); 
    $('#mask').fadeIn(300); 

    return false; 
}); 
}); 

HTML:

<div id="popup" class="corners"> 
</div> 

这就是代码被装入。只有在IE 7中,一个蒙版覆盖黑屏的弹出窗口。如果任何人有过类似的问题,我很想知道为什么发生这种情况只在IE 7

感谢

+0

它使两个IE7和IE10相同的输出。对我来说工作得很好。 –

+0

:什么?右上角的按钮是? – MaxwellLynn

回答

1

IE7有各种各样的,你必须解决..我的猜测是Z-“问题”指数问题...

“在Internet Explorer中定位的元素生成一个新的堆叠内容,从0的z-index值。因此z-index的工作不正常”

http://www.brenelz.com/blog/squish-the-internet-explorer-z-index-bug/

您可能需要修改密码/ css来适用的z-index到这个问题,以及您的<div id="container">元素..这样的事情:

<div id="container" style="position: relative; z-index: 2202"> 
    <div id="popup class="corners"></div> 
</div> 
<div id="mask"></div> 
相关问题