ASP.NET Accordian 中的嵌入式 Flash 表现不佳

发布于 2024-07-15 02:39:18 字数 3673 浏览 7 评论 0原文

我正在使用 ajax 工具包折叠扩展器,当我尝试在内容部分嵌入一些 Flash 时,我注意到它的表现有点“时髦”。

您可以在以下位置查看我现在的工作:http://kristinsconfections.com/gallery.aspx。 正如您所看到的,当您切换手风琴时,它有点不稳定。 我正在从 flickr 中提取 Flash 幻灯片,所以我根本无法控制它。 该网站仅供想要成为面包师的朋友使用,因此它不是高优先级,只是非常令人沮丧! 我可以使用 javascript、.net 甚至 jquery 做任何事情?

这是我在该页面上使用的确切代码:

<cc1:Accordion ID="MyAccordion" runat="server" SelectedIndex="0"
        HeaderCssClass="accordionHeader" ContentCssClass="accordionContent"
        FadeTransitions="true" FramesPerSecond="40" TransitionDuration="250" AutoSize="None">
        <Panes>
            <cc1:AccordionPane ID="pnlCakes" runat="server">
                <Header><div ><span style="float:left;">Cakes</span></div></Header>
                <Content>
                    <object width="572" height="429" type="application/x-shockwave-flash"
                     data="http://www.flickr.com/apps/slideshow/show.swf?v=67089"> 
                    <param name="flashvars" value="&offsite=true&amp;lang=en-us&page_show_url=%2Fphotos%2F28792515%40N08%2Fsets%2F72157612640424865%2Fshow%2F&page_show_back_url=%2Fphotos%2F28792515%40N08%2Fsets%2F72157612640424865%2F&set_id=72157612640424865&jump_to=" />
                    <param name="allowFullScreen" value="true" />
                    <param name="movie" value="http://www.flickr.com/apps/slideshow/show.swf?v=67089" />
                    </object>
                </Content>
            </cc1:AccordionPane>
             <cc1:AccordionPane ID="pnlCookies" runat="server">
                <Header><div ><span style="float:left;">Cookies</span></div></Header>
                <Content>
                 <object width="572" height="429"  type="application/x-shockwave-flash"
                 data="http://www.flickr.com/apps/slideshow/show.swf?v=67089"> 
                <param name="flashvars" value="&offsite=true&amp;lang=en-us&page_show_url=%2Fphotos%2F28792515%40N08%2Fsets%2F72157612640405779%2Fshow%2F&page_show_back_url=%2Fphotos%2F28792515%40N08%2Fsets%2F72157612640405779%2F&set_id=72157612640405779&jump_to=" />
                <param name="allowFullScreen" value="true" />
                <param name="movie" value="http://www.flickr.com/apps/slideshow/show.swf?v=67089" />
                </object>
                </Content>
            </cc1:AccordionPane>
            <cc1:AccordionPane ID="pnlCupcakes" runat="server">
                <Header><div ><span style="float:left;">Cupcakes</span></div></Header>
                <Content>
                <object width="572" height="429"  type="application/x-shockwave-flash"
                 data="http://www.flickr.com/apps/slideshow/show.swf?v=67089"> 
                <param name="flashvars" value="&offsite=true&amp;lang=en-us&page_show_url=%2Fphotos%2F28792515%40N08%2Fsets%2F72157612589253131%2Fshow%2F&page_show_back_url=%2Fphotos%2F28792515%40N08%2Fsets%2F72157612589253131%2F&set_id=72157612589253131&jump_to=" />
                <param name="allowFullScreen" value="true" />
                <param name="movie" value="http://www.flickr.com/apps/slideshow/show.swf?v=67089" />
                </object>
                </Content>
            </cc1:AccordionPane>
        </Panes>
</cc1:Accordion>

I'm using the ajax toolkit accordion extender and I notice it performs a little "funky" when I try to embed some flash in the content sections.

You can see what I have working now at : http://kristinsconfections.com/gallery.aspx.
As you can see when you toggle the accordion it's a little choppy. I'm pulling the flash slideshow from flickr so I can't control that at all. The site is only for a friend who is trying to become a baker so it's not high priority just highly frustrating!! Anything I can do using javascript, .net or even jquery??

Here is the exact code I am using on that page:

<cc1:Accordion ID="MyAccordion" runat="server" SelectedIndex="0"
        HeaderCssClass="accordionHeader" ContentCssClass="accordionContent"
        FadeTransitions="true" FramesPerSecond="40" TransitionDuration="250" AutoSize="None">
        <Panes>
            <cc1:AccordionPane ID="pnlCakes" runat="server">
                <Header><div ><span style="float:left;">Cakes</span></div></Header>
                <Content>
                    <object width="572" height="429" type="application/x-shockwave-flash"
                     data="http://www.flickr.com/apps/slideshow/show.swf?v=67089"> 
                    <param name="flashvars" value="&offsite=true&lang=en-us&page_show_url=%2Fphotos%2F28792515%40N08%2Fsets%2F72157612640424865%2Fshow%2F&page_show_back_url=%2Fphotos%2F28792515%40N08%2Fsets%2F72157612640424865%2F&set_id=72157612640424865&jump_to=" />
                    <param name="allowFullScreen" value="true" />
                    <param name="movie" value="http://www.flickr.com/apps/slideshow/show.swf?v=67089" />
                    </object>
                </Content>
            </cc1:AccordionPane>
             <cc1:AccordionPane ID="pnlCookies" runat="server">
                <Header><div ><span style="float:left;">Cookies</span></div></Header>
                <Content>
                 <object width="572" height="429"  type="application/x-shockwave-flash"
                 data="http://www.flickr.com/apps/slideshow/show.swf?v=67089"> 
                <param name="flashvars" value="&offsite=true&lang=en-us&page_show_url=%2Fphotos%2F28792515%40N08%2Fsets%2F72157612640405779%2Fshow%2F&page_show_back_url=%2Fphotos%2F28792515%40N08%2Fsets%2F72157612640405779%2F&set_id=72157612640405779&jump_to=" />
                <param name="allowFullScreen" value="true" />
                <param name="movie" value="http://www.flickr.com/apps/slideshow/show.swf?v=67089" />
                </object>
                </Content>
            </cc1:AccordionPane>
            <cc1:AccordionPane ID="pnlCupcakes" runat="server">
                <Header><div ><span style="float:left;">Cupcakes</span></div></Header>
                <Content>
                <object width="572" height="429"  type="application/x-shockwave-flash"
                 data="http://www.flickr.com/apps/slideshow/show.swf?v=67089"> 
                <param name="flashvars" value="&offsite=true&lang=en-us&page_show_url=%2Fphotos%2F28792515%40N08%2Fsets%2F72157612589253131%2Fshow%2F&page_show_back_url=%2Fphotos%2F28792515%40N08%2Fsets%2F72157612589253131%2F&set_id=72157612589253131&jump_to=" />
                <param name="allowFullScreen" value="true" />
                <param name="movie" value="http://www.flickr.com/apps/slideshow/show.swf?v=67089" />
                </object>
                </Content>
            </cc1:AccordionPane>
        </Panes>
</cc1:Accordion>

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

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

发布评论

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

评论(5

薄暮涼年 2024-07-22 02:39:18

我发现 Ajax 工具包的东西总的来说太笨重了。 JQuery 非常易于使用,具有良好的跨浏览器支持和可扩展性,因此我们优先使用它,我建议您也这样做。 JQuery UI 套件中有一个 accordian 小部件 应该符合要求。

如果将所有 Flash 影片加载到隐藏的 div 中会导致性能不佳,那么您可以挂钩一个事件来更改可以在 Flash 中加载的位置。 这在手风琴页面上有记录(并且可以使用 JQuery 轻松完成)。

I find the Ajax toolkit stuff too clunky in general. JQuery is so easy to use, has good cross browser support and extensibility that we use it in preference, and I would recommend you to do the same. There is an accordian widget in the JQuery UI suite that should fit the bill.

If having all of the Flash movies loading into the hidden divs gives you poor performance there is an event that you can hook into on change where you could load in the Flash. This is documented on the accordian page (and can easily be done with JQuery).

天荒地未老 2024-07-22 02:39:18

这似乎是 Firefox 中长期存在的bug,不特定于任何特定小部件。 我最好的尝试:

<script type="text/javascript">
    function pageLoad() {
        var acc = $find('<%= MyAccordion.ClientID %>_AccordionExtender');
        acc.add_selectedIndexChanged(MyAccordion_SelectedIndexChanged);
    }
    function MyAccordion_SelectedIndexChanged(sender) {
        $("object").css("visibility", "hidden");
        setTimeout(
            function() { 
                $("object").eq(sender.get_SelectedIndex()).css("visibility", "visible"); 
            }, 1000);
    }
</script>
  1. 隐藏对象可见性,以便手风琴动画播放
  2. 等待 1 秒 - 希望足够长的时间让动画完成,但不要太长,以免出现明显的滞后
  3. 显示隐藏的对象

这修复了闪烁,但闪光对象将动画播放时消失

It appears to be a long standing bug in firefox not specific to any particular widget. My best attempts:

<script type="text/javascript">
    function pageLoad() {
        var acc = $find('<%= MyAccordion.ClientID %>_AccordionExtender');
        acc.add_selectedIndexChanged(MyAccordion_SelectedIndexChanged);
    }
    function MyAccordion_SelectedIndexChanged(sender) {
        $("object").css("visibility", "hidden");
        setTimeout(
            function() { 
                $("object").eq(sender.get_SelectedIndex()).css("visibility", "visible"); 
            }, 1000);
    }
</script>
  1. Hide the object visibility so the accordion animations play through
  2. Wait 1 sec - hopefully long enough for the animations to finish, but not too long so that theres noticeable lag
  3. Show the hidden object

This fixes the flickering, but the flash object will disappear while the animations play through

眼泪淡了忧伤 2024-07-22 02:39:18

我在 FireFox3、IE8 和 Chrome 下测试了它,实际上它在 IE(版本 8)中似乎运行得很好,而在 FF3 和 Chrome 中则不太好。

我确实找到了这篇文章在某个地方遇到了同样的问题,似乎将 FadeTransitions 属性设置为“False”可以修复它,尽管我打赌这不是您所希望的解决方案。

I tested it under FireFox3, IE8 and Chrome, and it actually does seem to work nicely in IE (version 8), and not so nice in FF3 and Chrome.

I did find this post of somewhere who ran into the same problem, and it seems that settings the FadeTransitions property to 'False' fixes it, though I bet it is not the solution you were hoping for.

妞丶爷亲个 2024-07-22 02:39:18

您是否尝试过暂时将预览图像放入手风琴中? 那么当用户点击图像时使用javascript将其替换为flash呢? 我认为那看起来会好很多。

当有人在手风琴中选择不同的窗格时(不确定要监视的事件 - 查看 AccordionBehavior.js),那么您可以删除闪存,用图像替换它并继续。

我认为这样您就不必担心导致您出现问题的 Flash/浏览器交互。

Have you tried putting a preview image in the accordian for the time being? Then when the user clicks on the image using javascript to replace it with the flash? I think that would look a lot better.

When somebody selects a different pane in the accordian (not sure of the event to monitor--look in AccordionBehavior.js), then you could remove the flash, replace it with an image and proceed.

I think then you wouldn't have to worry about the flash / browser interaction that is causing you problems.

反话 2024-07-22 02:39:18

我还建议使用 jQuery 手风琴小部件。 我使用过它,它非常易于使用,重量轻,适用于所有浏览器,而且我没有发现任何错误。 有很多皮肤可供选择,如果到了紧要关头,构建自己的皮肤并不是那么痛苦。

除此之外,请查看嵌入 SWF 的方式,尤其是 wmode 属性。 这里写了一篇很好的解释性文章,你可以从那开始。 您可以忽略 GPUdirect 模式,因为我认为您没有使用为 Flash Player 10 编译的 SWF。

当然,您应该卸载那些不可见。

I would recommend using the jQuery accordion widget, also. I've worked with it and it very easy to use, light weight, works on all browsers and I've found no bugs whatsoever. There are a lot of skins you can choose for and, if push comes to shove, it's not really that much of a pain in the ass to build your own skin.

Besides that, take a look at the way you're embedding your SWFs, especially the wmode attribute. There's a good explanatory article written here, you could start with that. You can ignore the GPU and direct modes, because I think you're not using a SWF compiled for Flash Player 10.

And of course, you should unload the flash movies that are not visible.

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