模式窗口上的标签标签不起作用
Label tags on modal window not working
我正试图让我的模态窗口具有标签标签,这样我就可以创建一个登录窗口,但它们不会出现。这是一个链接我的小提琴
jQuery代码:
$(document).ready(function () {
// create variable to hold the current modal window
var activeWindow;
$('a.modalLink').click(function (e) {
// cancel the default link behaviour
e.preventDefault();
// find the href of the link that was clicked to use as an id
var id = $(this).attr('href');
// assign the window with matching id to the activeWindow variable, move it to the center of the screen and fade in
activeWindow = $('.window#' + id)
.css('opacity', '0') // set to an initial 0 opacity
.css('top', '50%') // position vertically at 50%
.css('left', '50%') // position horizontally at 50%
.fadeTo(500, 1); // fade to an opacity of 1 (100%) over 500 milliseconds
// create blind and fade in
$('#modal')
.append('<div id="blind" />') // create a <div> with an id of 'blind'
.find('#blind') // select the div we've just created
.css('opacity', '0') // set the initial opacity to 0
.fadeTo(500, 0.8) // fade in to an opacity of 0.8 (80%) over 500 milliseconds
.click(function (e) {
closeModal(); // close modal if someone clicks anywhere on the blind (outside of the window)
});
});
$('a.close').click(function (e) {
// cancel default behaviour
e.preventDefault();
// call the closeModal function passing this close button's window
closeModal();
});
function closeModal() {
// fade out window and then move back to off screen when fade completes
activeWindow.fadeOut(250, function () {
$(this).css('top', '-1000px').css('left', '-1000px');
});
// fade out blind and then remove it
$('#blind').fadeOut(250, function () {
$(this).remove();
});
}
由于该而不显示的元素
<form id="overlay_form" style='display:none'>
只要到达这个
<form id="overlay_form">
然后也删除这个
<a href="#" id="close">Close</a>
因为您需要的是class=close,而不是id=close。
这是您的更新小提琴。已更改
<form id="overlay_form" style='display:none'>
至
<div id="overlay_form">
因为这种形式没有结束语,它本身就有另一个结束语。
演示
相关文章:
- <选择>标签不起作用
- jQuery在<TR>TR折叠时标签不起作用
- Magento Jquery引导程序和原型冲突?导航标签不起作用
- Chart.js-悬停弹出-添加带值的标签-不起作用
- IOS Cordova/Phonegap 离线视频源标签不起作用
- Symfony - 嵌入表单中的食谱“添加新标签”不起作用
- jquery find() 和 remove() 脚本标签不起作用
- jQuery 按 ID 名称删除 img 标签不起作用
- 清除 DIV 标签不起作用
- jQuery 运行总计和输出标签不起作用
- 为什么我的 iframe 标签不起作用
- 安卓网络浏览器 B 标签不起作用
- 模式窗口上的标签标签不起作用
- 添加<李>jquery中的标签不起作用
- Vaadin标签不起作用
- Jquery click()事件对附加的HTML标签不起作用
- Jquery选择器对添加的标签不起作用
- 跨域Ajax的动态脚本标签不起作用
- jquery append和javascript appendChild对html标签不起作用
- 为什么click()对对象标签不起作用