1
我在玩shadowbox,我想在用戶登陸我的網站索引頁時啓動它。shadowbox(js)作爲彈出框
我可以像使用了太極拳:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>title</title>
<!-- Set paramètres pour le shadowbox (CSS, JS? . . .) -->
<link rel="stylesheet" type="text/css" href="shadowbox.css">
<script type="text/javascript" src="shadowbox.js"></script>
<script type="text/javascript">
Shadowbox.init();
</script>
</head>
<body>
<a href="image.png" rel="shadowbox" title="scronieunieu">My Image</a>
</body>
</html>
我試圖讓一個onload事件的功能,但它不工作(我無法設置鏈接的圖片就可以了?):
<script type="text/javascript" src="shadowbox.js"></script>
<script type="text/javascript">
window.addEvent('domready', function() {onPageLoad()});
window.onload = function(){
Shadowbox.init();
};
</script>
</head>
感謝幫助我,我對JS很糟糕......