简体   繁体   English

jPlayer播放列表标题元素

[英]jPlayer playlist title element

I have seen similar questions, but no solutions. 我见过类似的问题,但没有解决方案。 I have jPlayer working beautifully except for one thing... In "playlist" mode, the title element is set to display:none . 我让jPlayer进行了漂亮的工作,除了一件事...在“播放列表”模式下,标题元素设置为display:none Is there a setting in the constructor to override this? 构造函数中是否有设置可以覆盖此设置?

Thanks in advance 提前致谢

A solution is to use a jQuery listener and add the title programmatically as it plays... 一种解决方案是使用jQuery侦听器,并在播放时以编程方式添加标题...

$("#music").bind($.jPlayer.event.play, function(event)
{
    $.each(player.playlist, function(index, song)
    {
        if(index == player.current)
        {
            $(".songTitle").html(song.title);
        }
    });
});

Where #music is the div you initally attach jplayer too and .songTitle is the class of the element where you want the title displayed. 其中#music是您最初也附加了jplayer的div,而.songTitle是要显示标题的元素的类。

You can force the css to show the title item by adding "important" like this: 您可以通过添加“重要”来强制CSS显示标题项,如下所示:

div.jp-details {
    display: block !important;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM