在jquery问题中调用函数
虽然使用JQuery v1.3.2失败,但我尝试调用我的函数loadPopup()。 有什么建议吗? 非常感谢,在jquery问题中调用函数,jquery,dhtml,Jquery,Dhtml,虽然使用JQuery v1.3.2失败,但我尝试调用我的函数loadPopup()。 有什么建议吗? 非常感谢, $(this).find("a").each(function(i) { if ($(this).hasClass("selected") == false) { $(this).css("background-color", "#efefef"); alert(1); loadPopup(); alert(2
$(this).find("a").each(function(i) {
if ($(this).hasClass("selected") == false) {
$(this).css("background-color", "#efefef");
alert(1);
loadPopup();
alert(2);
}
})
function loadPopup() {
alert("");
}
对不起,我没有把整件东西都贴上
$(this).find("a").each(function(i) {
if ($(this).hasClass("selected") == false) {
$(this).css("background-color", "#efefef");
alert(1);
loadPopup();
alert(2);
}
})
如果您从根目录开始查找all
,以获取all,则似乎没有绑定href上的任何事件。这就是原因,即使单击链接,也不会调用您的loadPopup()
我希望以下代码可以帮助您:
$(this).find('A.selected').unbind('click').bind('click',function() {
loadPopup();
});
如果您正在查询表行等集合的内部,则可以将$(此)放在上面的代码中,也可以直接使用:$('A.selected')。取消绑定
..不要将此作为答案发布。编辑原始问题。好的,对不起,看不到要编辑的位置。。看到这里的html“Failing”不是很有帮助,它在做什么,没有做什么?loadPopup()中的警报从未显示。哇,这是什么…(?)我需要在6个div中的任何一个上方悬停时调用loadPopup。@James-你的意思是这样吗?(取消对警报的注释以查看其是否有效)我需要相应的UrgencyMessage div在悬停在6个框中的任何一个框上时变为可见。@James-我不确定您在背景色上的具体要求,这可能可以在CSS中完成,但这应该适用于
显示:谢谢,这就是我想要的,但是你能看到弹出窗口是如何被剪切的吗?因为OutboundDaySliderContainer上的overflow:hidden属性这就是我遇到的问题。
$("a").each(function(i) {
$("a:not(.selected)").css("background-color", "#efefef").each(function() {
loadPopup();
});
$(this).find('A.selected').unbind('click').bind('click',function() {
loadPopup();
});