当用户向下滚动时在折叠下方启动 Flash 横幅

发布于 2025-01-02 06:30:55 字数 1076 浏览 2 评论 0原文

我希望 Flash 横幅在首屏下方可见后就开始播放。

当访问者向下滚动并且可以在浏览器中查看时,它就开始播放。

这可能吗?我希望解决方案位于闪存之外,但只是希望它能够工作。目前,横幅不会自行重播,因此它会在可见之前播放到最后。如果它可以在可见时加载或开始播放,那么问题就可以解决。

我知道lazyloader可以在你向下滚动后加载图像,并且Facebook评论在你向下滚动后加载,但是你能对任何东西做同样的事情吗?特别是 Flash 横幅。

更新:我现在有优先级参数,但无法让它工作:

<script type="text/javascript" src="/swfobject.js"></script>
<script type="text/javascript">
            var flashvars = {};
            var params = {};
            params.loop = "true";
            params.hasPriority = "false";
            var attributes = {};
            attributes.id = "flash";
            swfobject.embedSWF("flash.swf", "myAlternativeContent", "1000", "300", "10.1.0", false, flashvars, params, attributes);
        </script>

        <div id="myAlternativeContent">
            <a href="http://www.adobe.com/go/getflashplayer">
                <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player">
            </a>
        </div>

I want to have a flash banner start playing once it becomes visible below the fold.

When the visitor scrolls down and it is viewable in the browser it starts playing.

Is this possible? I'd prefer if the solution was outside of flash but just want it to work. Currently the banner does not replay itself so it is playing to the end before it becomes visible. If it could load or start playing once its viewable that would solve the problem.

I know lazyloader can load images after you scroll down and facebook comments load once you scroll down but could you do the same thing with anything? in particular a flash banner.

Update: I've now the has priority paramter and can't get it to work:

<script type="text/javascript" src="/swfobject.js"></script>
<script type="text/javascript">
            var flashvars = {};
            var params = {};
            params.loop = "true";
            params.hasPriority = "false";
            var attributes = {};
            attributes.id = "flash";
            swfobject.embedSWF("flash.swf", "myAlternativeContent", "1000", "300", "10.1.0", false, flashvars, params, attributes);
        </script>

        <div id="myAlternativeContent">
            <a href="http://www.adobe.com/go/getflashplayer">
                <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player">
            </a>
        </div>

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

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

发布评论

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

评论(1

撧情箌佬 2025-01-09 06:30:55

嵌入时使用参数“hasPriority”。以下是此参数的帮助:http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c36cfb8137124318eebc6-8000.html

另一种方法是使用 JavaScript。有一个 jQuery 插件,可以在对象出现在视口中时绘制对象: jQuery Bullseye

Use param "hasPriority" when embeding. Here is help for this parameter: http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c36cfb8137124318eebc6-8000.html

Another approach is by using JavaScript. There is jQuery plugin for that that draws objects when they appear in viewport: jQuery Bullseye

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