通过JS调整flash大小 [英] Resize flash via JS

查看:60
本文介绍了通过JS调整flash大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,今天是关于js问题的两个特别之处。

BTW:这里使用的方法在Firefox中工作


我正在努力一个脚本,根据浏览器窗口的内部宽度,将Flash影片的宽度切换为100%到812像素。


重点是嵌入flash影片以进行全屏使用( 100%)它的行为有点像背景,如果窗口缩放到比闪存中的实际内容更小的尺寸,则不会导致滚动条。这意味着闪光灯被剪辑了,用户无法看到一些网站。


我的第一个解决方案是在下方放置一个''spacer''div闪烁以''抓住滚动条。我将div设置为802像素宽(与我的电影内容大小相同),这保留了滚动条,但有趣的是,当电影的宽度为100%时,它不会扩展到可滚动空间的宽度,而是设置为窗口的实际宽度(现在看起来很明显)。


因为我正在使用背景重复(并且我喜欢解决问题)设置固定宽度闪光灯并将其置于div中并不是一种选择。 :p虽然也许如果我变得棘手并且背景重复+偏移中心以与flash电影对齐....


好​​的,所以切入追逐。


这是我的JS代码(在Firefox中工作,控制台中没有javacript错误):


展开 | 选择 | Wrap | 行号

解决方案

非常有用,它适用于Netscape和Internet探索重要的改编。你还应该调整高度,onResize应该由onLoad补充,这样你就可以定位不同的分辨率和window.innerwidth不能用于IE所以你必须提供备用代码。

这是我的操作函数:

展开 | 选择 | Wrap | 行号



非常有用,它适用于Netscape和Internet Explored随着重要的适应。你还应该调整高度,onResize应该由onLoad补充,这样你就可以定位不同的分辨率和window.innerwidth不能用于IE所以你必须提供备用代码。

这是我的操作函数:

展开 | 选择 | Wrap | 行号


html文件如下: -

展开 | 选择 | Wrap | 行号

OK, today is my twofer special on js questions.
BTW: the method used here is working in Firefox

I''m working on a script that switches the width of a Flash movie between 100% and 812 pixels depending on the innerwidth of the browser window.

The point is when a flash movie is embedded for fullscreen usage (100%) it acts somewhat like a background, and won''t cause scrollbars if the window is scaled to a smaller size than the ''actual'' content in the flash. This means that the flash get''s clipped and the user can''t see some of the site.

My first solution was to place a ''spacer'' div below the flash to ''hold the scrollbars. I set the div to 802 pixels wide (the same size as my movie content) this kept the scroll bars, but interestingly, when the width of the movie is 100% it doesn''t expand to the width of the scrollable space, rather is set to the actual width of the window (seems obvious now).

Because i''m using a background repeat (and i like to figure things out) setting a fixed width for the flash and centering it in a div is not an option. :p Though maybe if I got tricky and centered a background repeat + offset the centering to align with the flash movie....

OK, so cut to the chase.

Here is my JS code (working in Firefox, with no javacript errors in the console):


Expand|Select|Wrap|Line Numbers

解决方案

Very helpful and it works in Netscape and Internet Explored with the important adaptations. You should also resize the height, the onResize should be supplemented by onLoad so you can target differing resolutions and window.innerwidth does not work with IE so you have to supply alternate code.
Here is my operating function:

Expand|Select|Wrap|Line Numbers


Very helpful and it works in Netscape and Internet Explored with the important adaptations. You should also resize the height, the onResize should be supplemented by onLoad so you can target differing resolutions and window.innerwidth does not work with IE so you have to supply alternate code.
Here is my operating function:

Expand|Select|Wrap|Line Numbers


the html file is as follows :-

Expand|Select|Wrap|Line Numbers


这篇关于通过JS调整flash大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆