缺失元素混乱
我正在创建一个脚本,该脚本会在 X 分钟后生成内容储物柜。问题是,likeButton 中的内容不会显示。模式弹出窗口显示良好,标题和说明也显示良好。只是不是 likeButton 内容。如果我从计时器中取出代码块,它就会起作用。我有点困惑。知道发生了什么事吗?
var title = 'Please Press Like';
var instructions = 'Like our videos? Join our fanpage. It takes 1 second.';
var lockDelay = 100; // 1200000 = 20 Minutes
/* STOP EDITING */
var boxy;
$(document).ready(function() {
// Create the like button
setTimeout(function() {
// Create the like button
var likeButton = '<div id="likeButton"><fb:like href="" send="false" layout="box_count" width="70" show_faces="false" font=""></fb:like></div>';
// Display the modal
boxy = new Boxy('<p id="instructions">' + instructions + '</p>' + likeButton, {
title: title,
modal: true,
closeable: false,
});
}, lockDelay);
// Close modal after user likes
$('#likeButton').mouseover(function() {
setTimeout(function() {boxy.hide()}, 3000);
});
});
I'm creating a script that produces a content locker after X number of minutes. The problem is, the content within likeButton will not display. The modal popup displays fine, as does the title and instructions. Just not the likeButton content. If I take the code block out of the timer, it works. I'm a little confused. Any idea whats going on?
var title = 'Please Press Like';
var instructions = 'Like our videos? Join our fanpage. It takes 1 second.';
var lockDelay = 100; // 1200000 = 20 Minutes
/* STOP EDITING */
var boxy;
$(document).ready(function() {
// Create the like button
setTimeout(function() {
// Create the like button
var likeButton = '<div id="likeButton"><fb:like href="" send="false" layout="box_count" width="70" show_faces="false" font=""></fb:like></div>';
// Display the modal
boxy = new Boxy('<p id="instructions">' + instructions + '</p>' + likeButton, {
title: title,
modal: true,
closeable: false,
});
}, lockDelay);
// Close modal after user likes
$('#likeButton').mouseover(function() {
setTimeout(function() {boxy.hide()}, 3000);
});
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个
Try this