gpt4 book ai didi

javascript - 对象不支持此属性或方法

转载 作者:行者123 更新时间:2023-11-28 20:48:55 24 4
gpt4 key购买 nike

$(document).ready(function () {
$('a.login-window').click(function () {
//Getting the variable's value from a link
var loginBox = $(this).attr('href');
//Fade in the Popup
$(loginBox).fadeIn(300);
//Set the center alignment padding + border see css style
var popMargTop = ($(loginBox).height() + 24) / 2;
var popMargLeft = ($(loginBox).width() + 24) / 2;
$(loginBox).css({
'margin-top': -popMargTop,
'margin-left': -popMargLeft
});
// Add the mask to body
$('body').append('<div id="mask"></div>');
$('#mask').fadeIn(300);
return false;
});
// When clicking on the button close or the mask layer the popup closed
$('a.close, #mask').live('click', function () {
$('#mask , .login-popup').fadeOut(300, function () {
$('#mask').remove();
});
return false;
});
});

我在我自己的电脑上调试 $(document).ready(function() 行时遇到了困难,这个问题不会发生,我现在使用的是另一台电脑,并且我一直遇到这个错误,该对象不支持此属性或方法。

最佳答案

在第 5 行,您将 loginBox 定义为 $(this).attr('href'),然后尝试在其上使用多个 jQuery 函数。这是不可能的,因为 loginBox 不是一个元素。

关于javascript - 对象不支持此属性或方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12888481/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com