是的。這是一個基本的實現。
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="shadowbox-3.0.3/shadowbox.css">
<style>
.botrplayer {display: none}
</style>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript" src="shadowbox-3.0.3/shadowbox.js"></script>
<script type="text/javascript">
Shadowbox.init({
skipSetup: true
});
$(document).ready(function(){
Shadowbox.setup($('.sbox'));//set up links with class of sbox
$('a.sbox').live('click',function(event){
Shadowbox.open({
content: $(this).siblings('.botrplayer').html(),
player: 'html',
title: "Welcome",
height: 280,
width: 490
});
//Stops loading link
event.preventDefault();
});
});
</script>
<title>bitsontherun shadowbox</title>
</head>
<body>
<p>The content of the document......</p>
<div>
<a href="#" class="sbox">Open bitsonthe run video</a>
<script type="text/javascript" src="http://content.bitsontherun.com/players/qgGMXVzB-Zdb9K7JT.js"></script>
</div>
</body>
</html>
如果包裝與script
元素div
你的鏈接,你可以重複使用他們所有這些代碼的。
這裏託管:http://sandbox.jamesfishwick.com/bitsontherun/index.html