如何根据蓝图 CSS 跨度范围调整 SWF 对象的大小?

发布于 2024-10-04 15:40:06 字数 608 浏览 1 评论 0原文

我正在使用 Blueprint CSS 创建 3 列布局:

LEFT COLUMN: span-6
CENTER COLUMN: span-12
RIGHT COLUMN: span-6

在中心列中,我想放置一个在初始化时需要固定大小的 SWF 对象:

swfobject.embedSWF(url, "flashDiv", flashWidth, flashHeight, params);

我可以计算相对于浏览器窗口的初始大小:

var flashWidth = window.innerWidth*0.50;
var flashHeight = window.innerHeight*0.50;

并使用 jQuery 调整大小:

$(window).height()

< em>但是如果蓝图布局确实根据浏览器而改变,那么这似乎是不必要的。

在这种情况下,我将如何计算相对于中心列的列宽的初始宽度和高度在这个布局(span-12)中?

I'm using Blueprint CSS to create a 3 column layout:

LEFT COLUMN: span-6
CENTER COLUMN: span-12
RIGHT COLUMN: span-6

In the center column I want to place an SWF object which needs a fixed size upon initialization:

swfobject.embedSWF(url, "flashDiv", flashWidth, flashHeight, params);

I could calculate the initial size relative to the browser window:

var flashWidth = window.innerWidth*0.50;
var flashHeight = window.innerHeight*0.50;

And resize with jQuery:

$(window).height()

But if a Blueprint layout does change based on the browser, then this would seem unnecessary.

In that case, how would I calculate the initial width and height relative to the column-width of the center column in this layout (span-12)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

爱的十字路口 2024-10-11 15:40:06

您可以创建一个按照您想要的方式运行的 HTML 元素,然后将 Flash 嵌入到大小为 100% x 100% 的 HTML 元素中

You'd make an HTML element that behaves in the way you want, then embed the Flash in the HTML element sized at 100% x 100%

萌无敌 2024-10-11 15:40:06

首先,我建议多考虑一下 flashHeight 值,因为它真的有可能是页面高度的 50% 吗?

其次,我认为动态调整闪存大小是不可能的,如果可以的话,我也不认为这是一个好主意。保持图形元素固定大小,并允许文本和自由格式元素随着页面大小的变化在它们周围流动。

Firstly I'd suggest thinking a little more about your flashHeight value as is it really likely to be 50% of the height of the page?

Secondly, resizing flash dynamically I don't believe is possible and I wouldn't think it's a good idea if you can. Keep your graphical elements a fixed size and allow the text and freeform elements to flow around them as the page size changes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文