如何根据蓝图 CSS 跨度范围调整 SWF 对象的大小?
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以创建一个按照您想要的方式运行的 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%
首先,我建议多考虑一下 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.