这是一个基于您的代码片段的工作示例,请检查这是否适合您的需求。
HTML:
<script type="text/javascript" src="http://fancyapps.com/fancybox/source/jquery.fancybox.js?v=2.0.6"></script>
<link rel="stylesheet" type="text/css" href="http://fancyapps.com/fancybox/source/jquery.fancybox.css?v=2.0.6" media="screen" />
<ul style="text-align: center; margin-top: 20px;">
<li><a class="fancybox" href="#inline1" title="Now Playing: Sample 1">Launch Sample 1</a></li>
<li><a class="fancybox" href="#inline2" title="Now Playing: Sample 2">Launch Sample 2</a></li>
<li><a class="fancybox" href="#inline3" title="Now Playing: Sample 3">Launch Sample 3</a></li>
</ul>
<div id="inline1" style="width: auto; display: none;" >
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width=200 height=20>
<param name="movie" value="http://96.245.187.180:80/player_mp3_maxi.swf" />
<param name="FlashVars" value="mp3=broadwavelow.mp3?src=fBroadWave Recording Example" />
<param name="quality" value="best" />
<embed src="http://96.245.187.180:80/player_mp3_maxi.swf" flashvars="mp3=broadwavelow.mp3?src=fBroadWave Recording Example" width=200 height=20 quality=best type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
<p>Sample 1</p>
</object>
</div>
<div id="inline2" style="width: auto; display: none;" >
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width=200 height=20>
<param name="movie" value="http://96.245.187.180:80/player_mp3_maxi.swf" />
<param name="FlashVars" value="mp3=broadwavelow.mp3?src=fBroadWave Recording Example" />
<param name="quality" value="best" />
<embed src="http://96.245.187.180:80/player_mp3_maxi.swf" flashvars="mp3=broadwavelow.mp3?src=fBroadWave Recording Example" width=200 height=20 quality=best type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>
<p>Sample 2</p>
</div>
<div id="inline3" style="width: auto; display: none;" >
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width=200 height=20>
<param name="movie" value="http://96.245.187.180:80/player_mp3_maxi.swf" />
<param name="FlashVars" value="mp3=broadwavelow.mp3?src=fBroadWave Recording Example" />
<param name="quality" value="best" />
<embed src="http://96.245.187.180:80/player_mp3_maxi.swf" flashvars="mp3=broadwavelow.mp3?src=fBroadWave Recording Example" width=200 height=20 quality=best type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
<p>Sample 3</p>
</object>
</div>
JS:
$(document).ready(function() {
$('.fancybox').fancybox();
});
所以基本上有3个隐藏的div,每个都有对应的播放器和.mp3。相应的 div 被加载到 fancybox 中(参见 href 中的值)。</p>
检查此链接以查看实际代码:http: //jsfiddle.net/hNLdk/祝你好运。