2010-10-01 30 views
0

我正在使用最新的jqueryui,并且在我的主页上有一个链接,它带有一个窗体对话框。现在在Firefox,IE和其他没有问题。只在铬上。它只是不会工作。你点击,它只是安静。 下面是简单的代码,获取对话框:jquery google chrome

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; 
     } 

有什么我失踪抑或是铬只是不喜欢我从中看到一些其他的所说的jQueryUI的未来的CSS的怪癖之一用户在这里。

+3

是否开发者控制台抱怨什么? – KFro 2010-10-01 01:12:35

+4

这是完整的代码吗? (因为我看到一些未封闭的括号和缺少分号) – 2010-10-01 01:15:31

+0

我认为你的代码中只有一些错误。你缺少一些括号和分号可能是........ – 2010-10-01 05:05:48

回答

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()