2012-12-31 2 views
0

Chrome 디버그 콘솔 (Chrome 버전 23.0.1271.97)에이 코드의 스크립트 탭이 표시되지 않습니다. 디버그해야 할 코드가 더 복잡해졌지만 Chrome Console 문제를 극복해야하므로이 예제를 제공했습니다. 이것에 대한 도움을 주시면 감사하겠습니다. 감사!Chrome 디버그 콘솔에이 코드의 스크립트 탭이 표시되지 않음

<!doctype html> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
<title>Draggable objects</title> 
<script type="text/javascript"> 

var bMouseUp = true, oDragging, nMouseX, nMouseY, nStartX, nStartY, nZFocus = 100 /* the highest z-Index present 

in  your page plus 1 */; 

function dragDown(oPssEvt1) { 
var bExit = true, oMsEvent1 = oPssEvt1 || /* IE */ window.event; 
for (var iNode = oMsEvent1.target; iNode; iNode = iNode.parentNode) { 
if (iNode.className === "draggable") { bExit = false; oDragging = iNode; break; } 
} 
if (bExit) { return; } 
bMouseUp = false; 
nStartX = nStartY = 0; 
for (var iOffPar = oDragging; iOffPar; iOffPar = iOffPar.offsetParent) { 
nStartX += iOffPar.offsetLeft; 
nStartY += iOffPar.offsetTop; 
} 
nMouseX = oMsEvent1.clientX; 
nMouseY = oMsEvent1.clientY; 
oDragging.style.zIndex = nZFocus++; 
return false; 
} 

function dragMove(oPssEvt2) { 
if (bMouseUp) { return; } 
var oMsEvent2 = oPssEvt2 || /* IE */ window.event; 
oDragging.style.left = String(nStartX + oMsEvent2.clientX - nMouseX) + "px"; 
oDragging.style.top = String(nStartY + oMsEvent2.clientY - nMouseY) + "px"; 
} 

function dragUp() { bMouseUp = true; } 

document.onmousedown = dragDown; 
document.onmousemove = dragMove; 
document.onmouseup = dragUp; 

</script> 


<style type="text/css"> 
.draggable { 
position: fixed; 
left: 0; 
top: 0; 
width: auto; 
height: auto; 
cursor: move; 
} 

#myDiv { 
width: 300px; 
height: 200px; 
left: 200px; 
top: 200px; 
background-color: #00ff00; 
} 
</style> 
</head> 

<body> 

답변

0

내 크롬 버전은 버전 25.0.1364.5 dev입니다. Max osX

그래서, 아마도 HTML-DOM 구조에 문제가있을 것이라고 생각합니다. 그렇지 않은 경우 탭 - "원본"을 열고 디버그 할 파일 (창의 왼쪽에있는 소스)을 선택할 수 있습니다.

가 마우스 이벤트, 당신은 크롬

https://developers.google.com/chrome-developer-tools/docs/remote-debugging

의 "원격 디버깅"을 고려할 수 있습니다 너무 많은
관련 문제