[英]Firebug changes the Javascript environment of Firefox 3.6
我正在使用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 });
});
遇到了同样的问题,删除console.log对我来说已经解决了。 我看到您已将其注释掉,但请检查您是否在其他地方未使用它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.