Flowplayer Overlay - 更改目标选择器

发布于 2024-12-11 23:49:26 字数 918 浏览 5 评论 0原文

在阅读了 Flowplayer 论坛中的一些主题和回复后,我发现你们可能会更好地帮助我解决问题。

您可能知道 Flowplayer 覆盖插件 使用 rel 属性以特定的覆盖容器为目标。例如:

<a href="#" id="signup" rel="#signupOverlay"></a>

$("#signup[rel]").overlay({
    mask: {
        color: '#000',
        loadSpeed: 200,
        opacity: 0.9
    }
});

我真的不想使用 rel 属性,而是使用 HTML5 数据属性。

所以它看起来像这样:

<a href="#" id="signup" data-overlay="#signupOverlay"></a>

$("#signup[data-overlay]").overlay({
    mask: {
        color: '#000',
        loadSpeed: 200,
        opacity: 0.9
    }
});

不幸的是,这不起作用。

因此,我还尝试将插件代码中的以下行: var n=e.target||d.attr("rel"); 更改为 var n=e.target| |d.attr("data-overlay");

但这也行不通。

如果你们中的任何一个人之前可能已经遇到过这个问题并解决了它,我很高兴听到如何解决!

After reading some topics and replies in the Flowplayer Forum, I figured out that you guys might be a better help for my problem.

As you may know the Flowplayer overlay plugin uses the rel attribute to target a specific overlay container. For example:

<a href="#" id="signup" rel="#signupOverlay"></a>

$("#signup[rel]").overlay({
    mask: {
        color: '#000',
        loadSpeed: 200,
        opacity: 0.9
    }
});

I would really like not to use the rel attribute, but the HTML5 data attribute instead.

So it would look like this:

<a href="#" id="signup" data-overlay="#signupOverlay"></a>

$("#signup[data-overlay]").overlay({
    mask: {
        color: '#000',
        loadSpeed: 200,
        opacity: 0.9
    }
});

Unfortunately, this doesn't work.

So, I have also tried to change following line in the plugin code: var n=e.target||d.attr("rel"); to var n=e.target||d.attr("data-overlay");

But this also doesn't work.

If any1 of you maybe already had this problem before and solved it, I would be glad to hear how!

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

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

发布评论

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

评论(1

王权女流氓 2024-12-18 23:49:26

试试这个:

$("#signup").live('click', function (event) {
    event.preventDefault(); //prevent default link action
    var $href = $(this).attr('data-overlay');
    $(this).overlay({
        target: $href,
        load: true
        });
});

我还没有这样测试过,但我已经根据与 href 而不是数据覆盖一起使用的代码对其进行了改编,并且它可以工作。我想这也会起作用。

Try this:

$("#signup").live('click', function (event) {
    event.preventDefault(); //prevent default link action
    var $href = $(this).attr('data-overlay');
    $(this).overlay({
        target: $href,
        load: true
        });
});

I haven't tested like that, but I have adapted it from a code that I use with href instead of data-overlay and it works. I guess that will work too.

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