2011-12-22 60 views
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> 

私はオンロード機能を作ってみましたが、それは(私はそれに絵へのリンクを設定することはできません?)働いていません。

<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に非常に悪いよ...

答えて

2
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
<title>Clemz</title> 

<!-- Set paramètres pour le shadowbox (CSS, JS? . . .) --> 
<link rel="stylesheet" type="text/css" href="shadowbox/shadowbox.css"> 
<script type="text/javascript" src="shadowbox/shadowbox.js"></script> 
<script type="text/javascript"> 
Shadowbox.init({ 
    // skip the automatic setup 
    skipSetup: true 
}); 

window.onload = function() { 
    // open ASA the window loads 
    Shadowbox.open({ 
     content: '<img src="image.png" alt="alt" />', 
     player:  "html", 
     title:  "Welcome dude", 
     height:  502, 
     width:  350 
    }); 
}; 
</script> 
</head> 

<body> 
<h1>Hello World</h1> 
</body> 
</html> 

作品proprely ;-)

関連する問題