javascript - jQuery:FireFox 3.0.1 中的宽度和高度未更改

标签 javascript jquery firefox

我目前正在使用 jQuery 用户界面来调整 DIV 的大小,并调整 DIV 内的 YouTube 视频的大小。

http://jimenglandweb.com/projects/jquery/instancecontainer.html

当调整包含的 DIV 大小时,YouTube 视频也应随之调整:

 $("#instanceContent").resizable({
        maxWidth: 425,  maxHeight: 344,
        minWidth: 213,  minHeight: 173,

        resize: function(e, ui) {
            $("#youtubes").width(ui.size.width-5);
            $("#youtubes").height(ui.size.height-5);
        }
    });

这在 Google Chrome 中工作正常,但在 FireFox 中存在问题。问题出在 .width 和 .height 上。有谁知道 1) 为什么这不起作用以及 2) 是否有解决方案?

最佳答案

试试这个:

$("#instanceContent").resizable({
    maxWidth: 425,  maxHeight: 344,
    minWidth: 213,  minHeight: 173,

    resize: function(e, ui) {
        $("#youtubes").css({
            width : (ui.size.width - 5),
            height : (ui.size.height - 5)
        });
    }
 });

关于javascript - jQuery:FireFox 3.0.1 中的宽度和高度未更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/957196/

相关文章:

jquery - TypeError HTMLSpanElement没有方法 'html'

javascript - 使用 jquery/coffeescript 发送和获取参数

css - 我的 LI 按钮在 Firefox 中是 "taller"

css - 输入范围样式 IE11/Firefox 与 Chrome 相同

javascript - Angular 中 setTimeout 的正确处理

javascript - noUiSlider - wNumb 仅格式化第一个 slider

javascript - 如何停止 JavaScript 中嵌套 try/catch 错误的传播?

javascript - Bootstrap 弹出窗口对我来说永远不起作用

jquery - 如何限制选择列表 - 在 KnockoutJS 中只选择一个元素

javascript - 在 firefox 中,如何在本地文件中运行 javascript,例如文件 :///C:/play/my. html