Hai*_*ood 4 javascript jquery shadowbox
我想在谷歌浏览器中使用shadowbox 3.0.3
我正进入(状态:
在铬
shadowbox.js:17未捕获的TypeError:无法读取未定义的属性"样式"
在Firefox中
F未定义g.find =(function(){var aD = /((?:((?:( ...()}}; g.skin = k; T.Shadowbox = g})(窗口); shadowbox.js(第17行)
似乎在IE中运行良好
我的代码如下:
<!doctype html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js"></script>
<script src="shadowbox.js"></script>
<link href="shadowbox.css" rel="stylesheet"/>
<script>
$(function() {
Shadowbox.init({skipSetup: true});
// open a welcome message as soon as the window loads
Shadowbox.open({
content: '<div id="welcome-msg">Welcome to my website!</div>',
player: "html",
title: "Welcome",
height: 350,
width: 350
});
})
</script>
</head>
<body>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
会造成什么?
使用docs中建议的window.load方法:
<script type="text/javascript">
Shadowbox.init({
skipSetup: true
});
$(window).load(function() {
// open a welcome message as soon as the window loads
Shadowbox.open({
content: '<div id="welcome-msg">Welcome to my website!</div>',
player: "html",
title: "Welcome",
height: 350,
width: 350
});
});
</script>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8279 次 |
| 最近记录: |