2011-05-02 54 views
0

使用coda-slider並更改css文件中的面板大小導致JQuery。我這樣做來調整尾部滑塊到大小窗口。 這在Firefox中運行正常,但會導致Chrome和Safari崩潰。 任何人都知道我該如何解決這個問題?CSS的JQuery屬性更改不會在Chrome中工作

這是函數

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

+3

jQuery在哪裏?如果您使用該庫,請使用它。 – Blender 2011-05-02 23:07:09

+0

該鏈接重定向到包含大量彈出窗口的根目錄,並且通常看起來像是要避免的東西。 – 2011-05-02 23:10:52

+0

我認爲它可能會停放。 – Blender 2011-05-02 23:12:24

回答

5

使用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"); 
} 
+0

仍然不會工作....仍然在鉻和Safari瀏覽器崩潰。在IE中凍結ajax「加載」。任何其他想法?我已經更新了www.segundafeirafilmes.com.br/prov/INDEX.html – alexandrecfb 2011-05-04 17:49:19

+0

這樣的網頁,如chrome不會支持jquery。有什麼方法可以發現?或者改變我改變CSS類屬性的方式? – alexandrecfb 2011-05-06 16:53:10

+0

使用Chrome瀏覽器,它對我來說工作得很好。通過** W3C獨角獸驗證器**運行它以查看任何標記錯誤。另外,我懷疑像7個JS文件一樣加載會有助於提高性能。 – Blender 2011-05-08 03:45:40

1

document.widthdocument.height是非標準的Netscape 4時代DOM0其他瀏覽器不要不一定會實施。特別是,WebKit沒有實現它們。而且Firefox 6也會放棄對它們的支持。

+0

FF6?哇,Mozilla真的很有計劃! – Blender 2011-05-02 23:30:12

+0

Firefox 6計劃從現在起不到4個月。 Firefox 5功能齊全,已經連續3周,計劃從現在開始發貨約一個半月。換句話說,這個問題中的代碼將在8月中旬停止在Firefox中工作。 – 2011-05-03 01:18:01