CSS 的 JQuery 属性更改在 Chrome 中不起作用

标签 jquery css firefox google-chrome safari

我正在使用 coda-slider 并通过 JQuery 在 css 文件中更改面板大小。我这样做是为了将 coda-slider 调整到大小窗口。 这在 Firefox 中运行良好,但会导致 Chrome 和 Safari 崩溃。 任何人都知道我该如何解决这个问题?

这是函数

function resizeCentro() {
        var alt = (document.height * 0.95) + "px";
        var larg = (document.width * 0.77) + "px";

        $(".coda-slider").css('width', larg);
        $(".coda-slider").css('height', alt);

        $(".panel-wrapper").css('width', larg);
        $(".panel-wrapper").css('height', alt); 

        document.getElementById("ifInicio").width = document.width * 0.95;
        document.getElementById("ifInicio").height = document.height * 0.95;
        document.getElementById("ifInicio").src = "inicio.html";

}

页面可以在http://www.segundafeirafilmes.com.be/prov/INDEX.html中查看

最佳答案

使用 moar jQuery:

function resizeCentro() {
    $(".coda-slider, .panel-wrapper").width($(document).width() * 0.77;);
    $(".coda-slider, .panel-wrapper, #ifInicio").height($(document).height() * 0.95);

    $("#ifInicio").width($(document).width() * 0.95);
    $("#ifInicio").attr('src', "inicio.html");
}

关于CSS 的 JQuery 属性更改在 Chrome 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5863433/

相关文章:

javascript - 验证轨道中的空间

javascript - 如何使用 FnFilter() 在多选中获得精确匹配?

css - 在菜单之间添加标题图像

php - Jquery 没有为我的导航菜单添加或删除我选择的类

html - 如何使用 css 设置 anchor 标记文本宽度?

html - 没有当前目录的相对路径

javascript - 如何使用 jQuery 获取由分隔符分隔的多个元素的文本?

javascript - 使用 jQuery 在 2 个引号之间查找文本

html - 您所在链接的 css 选择器

javascript - 在浏览器中查看源代码时显示的源代码是否始终准确/完整?