2011-06-03 118 views
0

为什么下面的代码会导致Firebug报告$('#galleria').galleria({行上的错误?缺少:属性ID后

 $('#galleria').galleria({ 
       dataSource: data, 
       width:930, 
       height:575, 
       transition: 'fade', 
       carousel: 'true' , 
       carouselSpeed: 1200 , 
       showCounter :'false', 
       showImagenav : 'false', 
       showInfo : 'false', 
       imageCrop : 'true', 
       maxScaleRatio: 1, 


       extend: function() { 
       this.bind(Galleria.LOADFINISH, function(e) { 
       $(e.imageTarget).css('cursor','pointer').click(this.proxy(function(e) { 
        e.preventDefault(); // removes the garbage 
        $.fancybox({ 

         $('#galleria').galleria({ 
          width: 500, 
          height: 500 
         });   

        }); 
       })) 
       }); 
       }  
     }); 
+0

http://jslint.com。 – 2011-06-03 15:39:57

回答

0

我不是专家,但是否缺少}));

像这样:

 $(e.imageTarget).css('cursor','pointer').click(this.proxy(function(e) { 
       e.preventDefault(); // removes the garbage 
       $.fancybox({ 

        $('#galleria').galleria({ 
         width: 500, 
         height: 500 
        });   

       }); 
      })); //here 
2
$.fancybox({ 

     $('#galleria').galleria({ 
      width: 500, 
      height: 500 
     });   

    }); 

在语法上是无效的。