Php JQuery在IE 8或7中不起作用
我在这里有这个网站,在左边的导航中,我使用jQuery删除一个类并将其添加到当前页面上,如果您单击Php JQuery在IE 8或7中不起作用,php,javascript,jquery,css,Php,Javascript,Jquery,Css,我在这里有这个网站,在左边的导航中,我使用jQuery删除一个类并将其添加到当前页面上,如果您单击菜单链接,它应该会显示一个子菜单 <script type="text/javascript"> $( '.navigation li a' ).each(function() { $(this).removeClass('active'); }); $('.navigation li ul.menu-submenu').hide(); $
菜单
链接,它应该会显示一个子菜单
<script type="text/javascript">
$( '.navigation li a' ).each(function() {
$(this).removeClass('active');
});
$('.navigation li ul.menu-submenu').hide();
$('.navigation li a').eq(6).addClass("active");
</script>
$('.navigation li a')。每个(函数(){
$(this.removeClass('active');
});
$('.navigation li ul.menu子菜单').hide();
$('.navigation li a').eq(6).addClass(“活动”);
以上是我在每个单独页面中更新导航的代码
在我的header.php文件中,我有以下内容:
<script type="text/javascript" src="js/jquery-2.0.3.min.js"></script>
<script type="text/javascript">
$(window).load(function () {
var theWindow = $(window),
$bg = $("#bg"),
aspectRatio = $bg.width() / $bg.height();
function resizeBg() {
if ((theWindow.width() / theWindow.height()) < aspectRatio) {
$bg.removeClass()
.addClass('bgheight');
} else {
$bg.removeClass()
.addClass('bgwidth');
}
}
theWindow.resize(resizeBg).trigger("resize");
});
</script>
$(窗口)。加载(函数(){
var theWindow=$(窗口),
$bg=$(“#bg”),
aspectRatio=$bg.width()/$bg.height();
函数resizeBg(){
如果((theWindow.width()/theWindow.height())
这会影响我的导航吗
所有包含php include的页面都包含header.php文件。jQuery 2.x已删除。改用jquery1.10.x。要归功于Rob W.jQuery 2.x已经放弃了对旧IE版本的支持。使用jQuery 1.10.x代替.AFAIK,jQuery 2不支持IE 7或8。当它已经发生时,为什么要在窗口上触发
resize
,它不能由任何字符控制。