0

Firebug 1.7.3 を使用して、Firefox 3.6.21 でサイトのデバッグを行っていました。ページが最初に読み込まれるときに、実行しようとしている Javascript がまったく読み込まれません。Firebug を開いて問題を確認し、リロードを押したところ、突然動作するようになりました。

ここで何が起こっているのかわかりません。

function initStations() {
  //console.log("in stations")
  ringContainer = $("#ringContainer");
  ringWidth = ringHeight = ringContainer.innerWidth();
  //console.log(ringWidth + " " + ringHeight);
  originX = (ringWidth / 2) - 0;
  originY = (ringHeight / 2);
  radius = originY + 20;
  //console.log(originX + " " + originY + " " + radius);
  // get the ul containing the stations
  stationList = $("#stationList");
  // an array of the li elements
  stationLiElems = $("#stationList li");
  // how many stations
  length = stationLiElems.size();
  // distance between stations in degrees
  spacing = (360 / length)
  // 360 degrees in circle divided by the number of stations
  // array of stations
  stations = [];
  // debug
  //console.log(stationList);
  stationLiElems.each(function(index, element) {
  //console.log(index +" - "+ spacing);
  stations[index] = {
    'element' : element,
    // http://stackoverflow.com/questions/925118/algorithm-for-finding-out-pixel-coordinates-on-a-circumference-of-a-circle
    'x' : originX + radius * Math.sin(spacing * index * 0.0174532925 ),
    'y' : originY + radius * Math.cos(spacing * index * 0.0174532925 )
  }
  $(element).css({'top' : stations[index].y , 'left' : stations[index].x });
});
4

1 に答える 1

0

これと同じ問題があり、console.log を削除すると解決しました。コメントアウトされているようですが、他の場所で使用していないことを確認してください。

于 2012-06-15T11:57:23.703 に答える