Skip to content

discuz 7 背景音乐插件之隐藏播放器

2009 六月 5
by 荒野无灯

有网友今天问我如何添加”隐藏播放器”的按钮,我想这个问题在必要写个文章作个说明,可能在以后的版本中会把代码加进去。
修改插件文件index.php

1
</head>

前面加上如下代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<script type="text/javascript">
   

function openPlayer()
{
document.getElementById('player').style.top ='  <?php echo $musicPlayerTop;?> ';
document.getElementById('plctrlopen').style.display = 'none';
document.getElementById('plctrlclose').style.display = 'inline';
}
function hidePlayer()
{
document.getElementById('player').style.top = '-500';
document.getElementById('plctrlopen').style.display = 'block';
document.getElementById('plctrlclose').style.display = 'none';

}


</script>

再在

1
2
<body scroll="no">
<div id="ajaxwaitid"></div>

下面加上:

1
2
<span id="plctrlclose" style=" position: absolute;background:transparent ;right:10%;top:<?php echo $musicPlayerTop+5;?>px;"><a href="#" onclick="hidePlayer();return false;"><span style="color:green;">隐藏播放器</span></a></span>
<span id="plctrlopen" style="position: absolute; display:none;background:transparent ;right:10%;top:<?php echo $musicPlayerTop+5;?>px;"><a href="#" onclick=" openPlayer();return false;"><span style="color:green;">显示播放器</span></a></span>

这样就可以了。

hide player

喜欢这篇文章吗?

请订阅本站 RSS feed填写您的邮件地址,订阅我们的精彩内容:,欢迎点击这里捐赠以支持荒野无灯转播到腾讯微博 转播到腾讯微博

作者:荒野无灯
出处:Hacklog【Hacklog】

声明: 本站遵循 署名-非商业性使用-相同方式共享 3.0 共享协议. 转载请注明转自Hacklog【荒野无灯weblog】

本文链接: http://ihacklog.com/?p=2318

3 Responses Post a comment
  1. 七月 29, 2009

    你好,可以发一份最新的播放器给我吗?
    1862006@qq.com

  2. 六月 9, 2009

    过几天可能真的要向你请教DZ的问题了。呵呵。

    因为前段朋友说要一起弄一个。嗯。

Leave a Reply

Allowed Tags - You may use these HTML tags and attributes in your comment.

<a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <q cite=""> <strong>

 :wink:  :-|  :-x  :twisted:  :)  8-O  :(  :roll:  :-P  :oops:  :-o  :mrgreen:  :lol:  :idea:  :-D  :evil:  :cry:  8)  :arrow:  :-?  :?:  :!:

Note: You may use basic HTML in your comments. Your email address will not be published.

Subscribe to this comment feed via RSS