📄 dragpanel.aspx
字号:
// Validate that the panel has moved down from its original location
function checkHasMovedVertical(position) {
return function() {
testHarness.assertNotEqual(panel.offsetTop, position, 'Top of panel has not moved from position ' + position);
};
}
// Validate that the panel has moved right from its original location
function checkHasMovedHorizontal(position) {
return function() {
testHarness.assertNotEqual(panel.offsetLeft, position, 'Left side of panel has not moved from position ' + position);
};
}
// Validate that the panel has moved from the specified location
function checkHasMoved(top, left) {
return function() {
checkHasMovedVertical(top);
checkHasMovedHorizontal(left);
};
}
// Fire an onmousedown event at point (x,y)
function mouseDown(element, x, y) {
return function() {
var e = testHarness.getDocument().createEvent('MouseEvents');
e.initMouseEvent('mousedown', true, false, window, 0, x, y, x, y, false, false, false, false, 0, null);
element.dispatchEvent(e);
};
}
// Fire an onmousemove event ending at point (x,y)
function mouseMove(element, x, y) {
return function() {
var e = testHarness.getDocument().createEvent('MouseEvents');
e.initMouseEvent('mousemove', true, false, window, 0, x, y, x, y, false, false, false, false, 0, null);
element.dispatchEvent(e);
};
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -