2011-05-08 96 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