第二个 fancybox 会给我一个错误“无法加载请求的内容”寄存器。 inlog fancybox 对我来说工作正常,有什么问题吗?我用 Google 搜索了一下,他们说了一些 iframe 类型的内容,但是当我这样做时,加载图标会不断旋转并且不显示内容。
jQuery
$(document).ready(function() {
$("a.inlog").fancybox({
maxWidth : 250,
maxHeight : 100,
fitToView : false,
autoSize : false,
closeClick : false,
openEffect : 'none',
closeEffect : 'none'
});
});
$(document).ready(function() {
$("a.register").fancybox({
maxWidth : 250,
maxHeight : 100,
fitToView : false,
autoSize : false,
closeClick : false,
openEffect : 'none',
closeEffect : 'none'
});
});
HTML
<div class="login-bottom"> <a class="decoration inlog" href="#inlog"><span class="knop-text">login</span></a>
<div id="inlog" style="display: none;">
<form class="form" action="">
<label>Gebruikersnaam:</label>
<input class="input" type="text" name="fname" />
<br />
<label>Wachtwoord:</label>
<input class="input" type="password" name="lname" />
<br />
<input class="submit" type="submit" value="login" />
</form>
</div>
</div>
<div class="login-bottom"> <a class="decoration register" href="#register"><span class="knop-text">registreer</span></a>
<div id="#register" style="display: none;">
<form class="form" action="">
<label>Gebruikersnaam:</label>
<input class="input" type="text" name="fname" />
<br />
<label>Wachtwoord:</label>
<input class="input" type="password" name="lname" />
<br />
<label>LoL gebruikersnaam:</label>
<input class="input" type="text" name="fname" />
<br />
<label>E-mail:</label>
<input class="input" type="text" name="fname" />
<br />
<input class="submit" type="submit" value="login" />
</form>
</div>
</div>
最佳答案
您应该使用 #
来引用特定的选择器,ID 或 .
(点)类你的 jQuery 代码,但不在你的 html 中,所以这个
<div id="#register" ...
应该是这个
<div id="register" ...
修正后工作 JSFIDDLE
关于javascript - 2 内联 fancybox,第二个 fancybox 出现错误 "The requested content cannot be loaded",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19480052/