2014-10-09 65 views
2

我確信我會因此而失去點數,因爲我無法提供該問題的具體細節,但我無法弄清楚哪個部分導致問題...jQuery在Internet Explorer中未按預期運行

http://thetally.efinancialnews.com/tallyassets/advisors/index.html

這是一個交互式圖形,它在鉻合金中工作正常。它包含一些變量,當你點擊中間的不同按鈕時,這些變量會發生變化,而一些動畫函數使用這些變量來調整外部銀行的大小。

看了一些其他的建議後,我添加了'px'的動畫功能,但沒有任何效果。奇怪的是簡單的翻轉,也使用動畫功能工作正常,但更高級的使用變量不會。

任何人都可以在jQuery中看到任何可以阻止它運行的東西嗎?讓我知道如果你需要任何更多的信息,感謝

這裏是jQuery的:

$(document).ready(function() { 

    var title = 0; 

    $(".bank").mousemove(function(e) { 
     $(this).find('.tooltip').css('left', e.pageX + 10).css('top', e.pageY + 10).css('display', 'block'); 
    }); 

    $(".bank").mouseout(function() { 
     $(this).find('.tooltip').css('display', 'none'); 
    }); 

    var resize = function() { 

     $('.bank').each(function() { 
      bankName = $(this).attr('class').split(' ')[1]; 

      var bankSize = window[bankName] * 15; 
      var bankNameMargin = bankSize/2 - bankSize; 

      $('.banks .' + bankName).animate({ 
       width: bankSize + 'px', 
       height: bankSize + 'px', 
       marginLeft: bankNameMargin + 'px', 
       marginTop: bankNameMargin + 'px' 
      }, 300); 

      if (bankSize == 0) { 

       $('.banks .' + bankName).animate({ 
        opacity: '0', 
        width: '70px', 
        height: '70px', 
        marginLeft: '-35px', 
        marginTop: '-35px' 
       }, 300, "linear", function() { 
        $(this).css({ 
         "opacity": "1", 
         "width": "0px", 
         "height": "0px", 
         "marginLeft": "0px", 
         "marginTop": "0px" 
        }); 
       }); 
      } 

     }); 

    } 

    resize(); 

    $(".bank").mouseenter(function() { 
     $(this).animate({ 
      width: '+=10', 
      height: '+=10', 
      marginLeft: '-=5', 
      marginTop: '-=5' 
     }, 200); 
    }); 

    $(".bank").mouseleave(function() { 
     $(this).animate({ 
      width: '-=10', 
      height: '-=10', 
      marginLeft: '+=5', 
      marginTop: '+=5' 
     }, 200); 
    }); 

    $(".button1").click(function() { 
     title = 1; 
    }); 

    $(".button2").click(function() { 
     title = 2; 
    }); 

    $(".button3").click(function() { 
     title = 3; 
    }); 

    $(".reset").click(function() { 
     $(".active").removeClass("active"); 
     $('.banks .bank').animate({ 
      width: '70px', 
      height: '70px', 
      marginLeft: '-35px', 
      marginTop: '-35px' 
     }, 300, "linear"); 
     title = 0; 
    }); 

    $(".button").click(function(e) { 
     $(".active").removeClass("active"); 
     $(".tooltip p").remove(); 
     $(".choose").remove(); 
     $(this).addClass("active"); 
     console.log(title); 
     if (title == 1) { 

      $('.barclays .tooltip').append("<p>Deals: 3</p><p>Percentage: 30%</p>"); 

      barclays = 4; 
      hsbc = 2; 
      morgan = 4; 
      citi = 2; 
      baml = 4; 
      jpmorgan = 2; 
      goldman = 7; 
      ubs = 3; 
      suisse = 2; 
      deutsche = 3; 
      jefferies = 2; 
      nomura = 1; 
      bnp = 1; 
      numis = 0; 
     } else if (title == 2) { 
      barclays = 5; 
      hsbc = 3; 
      morgan = 3; 
      citi = 2; 
      baml = 2; 
      jpmorgan = 9; 
      goldman = 5; 
      ubs = 4; 
      suisse = 4; 
      deutsche = 5; 
      jefferies = 1; 
      nomura = 0; 
      bnp = 1; 
      numis = 3; 
     } else if (title == 3) { 
      barclays = 0; 
      hsbc = 0; 
      morgan = 5; 
      citi = 2; 
      baml = 2; 
      jpmorgan = 7; 
      goldman = 2; 
      ubs = 5; 
      suisse = 2; 
      deutsche = 4; 
      jefferies = 2; 
      nomura = 5; 
      bnp = 2; 
      numis = 0; 
     } 

     resize(); 

    }); 

}); 
+0

而你的代碼是......什麼? – 2014-10-09 11:15:14

+2

有沒有特定版本的IE這不起作用? – Alex 2014-10-09 11:15:43

+0

我添加了jQuery,但它也可以通過鏈接訪問。爲什麼,它在IE中對你有用嗎?我在Mac上,但創建它的人需要IE兼容。我沒有訪問IE來正確地測試它 – bboybeatle 2014-10-09 11:18:15

回答