2011-05-08 72 views
0

我得到一个语法错误,我猜(?)这是因为$ ???它应该如何呢?jquery语法错误

  case 2: // move event 
        if ((swipeDirection === 'down') 
         $(".latest_img").fadeTo("slow", 1.0); // The white box is completely 100% 
         $(".latest_img").hover(function(){ 
         $(this).fadeTo("slow", 0.1); // The white box fades away 
         },function(){ 
         $(this).fadeTo("slow", 0); // The white box stays away after finger leaves image 
         }); 
        } else { 
       document.getElementById('swipe-frame').style.backgroundImage = "url(11.png)"; 

回答

1

你有一个额外的(并且是完全缺少{IF语句的行...

   case 2: // move event 
        if (swipeDirection === 'down') { 
         $(".latest_img").fadeTo("slow", 1.0); // The white box is completely 100% 
         $(".latest_img").hover(function(){ 
         $(this).fadeTo("slow", 0.1); // The white box fades away 
         },function(){ 
         $(this).fadeTo("slow", 0); // The white box stays away after finger leaves image 
         }); 
        } else { 
       document.getElementById('swipe-frame').style.backgroundImage = "url(11.png)"; 
+0

,谢谢。 – dmccallum 2011-05-08 21:17:12