我正在使用最新的jqueryui,并在我的主页上有一个带有表单对话框的链接。现在在Firefox,IE和其他人没有问题。仅限铬合金。它不会起作用。你点击它,它只是安静。 以下是获取对话框的简单代码:
var diagopt = {
autoOpen: true,
title: 'Get a Quote Sent to you!',
modal: true,
width: 400,
height: 350 } d.each(function(){ //d is a variable holding jquery object
$(this).click(function(eve){
if($(this).attr('id') == links[1]) //array with id of target elements
{
$('#getquote').dialog(diagopt);
return false;
}
我有什么遗漏,或者是那些css怪癖之一,Chrome不喜欢来自jqueryui,我在这里看到其他一些用户所说的。
答案 0 :(得分:2)
在d.each
之前尝试使用分号,并确保使用.each(function() {
关闭.click(function() {
和});
:
var diagopt = {
autoOpen: true,
title: 'Get a Quote Sent to you!',
modal: true,
width: 400,
height: 350 }; // <== semicolon
d.each(function(){ //d is a variable holding jquery object
$(this).click(function(eve){ // <== Note that eve is never used.
if($(this).attr('id') == links[1]) //array with id of target elements
{
$('#getquote').dialog(diagopt);
return false;
}
}); // <== close the .click()
}); // <== close the .each()