我正在使用 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/