jQuery 두 개의 스크롤을 동시에 이동하기.

Registers:
EAX=0x0030ec30, EBX=0x04d5ba28, ECX=0x0030ec30, EDX=0x0030f01c
ESP=0x04feefd0, EBP=0x04feefe0, ESI=0x00000000, EDI=0x00000030
EIP=0x49151000, EFLAGS=0x00010246

Top of Stack: (sp=0x04feefd0)
0x04feefd0: 6924a4f9 00000030 0030ec30 04d60c00
0x04feefe0: 04fef138 691bd7a7 00000004 04d60c00
0x04feeff0: 04fef150 00000000 000000a0 04d60c00
0x04fef000: 00000011 00000004 00000003 00000000
0x04fef010: 00000000 00000004 00000003 0030ec28
0x04fef020: 0030ec30 0030f01c 00000004 00000006
0x04fef030: 04d60d28 00000000 00000000 00000000
0x04fef040: 00000000 00000001 00000016 00000000

Instructions: (pc=0x49151000)
0x49150fe0:
[error occurred during error reporting (printing registers, top of stack, instructions near pc), id 0xc0000005]

Register to memory mapping:

EAX=0x0030ec30 is an unknown value
EBX=0x04d5ba28 is an unknown value
ECX=0x0030ec30 is an unknown value
EDX=0x0030f01c is an unknown value
ESP=0x04feefd0 is pointing into the stack for thread: 0x04d60c00
EBP=0x04feefe0 is pointing into the stack for thread: 0x04d60c00
ESI=0x00000000 is an unknown value
EDI=0x00000030 is an unknown value

Stack: [0x04fa0000,0x04ff0000], sp=0x04feefd0, free space=315k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C 0x49151000
V [jvm.dll+0xdd7a7]
J java.security.AccessController.getStackAccessControlContext()Ljava/security/AccessControlContext;
J java.awt.AWTEvent.(Ljava/lang/Object;I)V
j sun.awt.GlobalCursorManager.updateCursorLater(Ljava/awt/Component;)V+16
j sun.awt.windows.WGlobalCursorManager.nativeUpdateCursor(Ljava/awt/Component;)V+4
v ~StubRoutines::call_stub
V [jvm.dll+0x12a39a]
V [jvm.dll+0x1d978e]
V [jvm.dll+0x12a41d]
V [jvm.dll+0xaee94]
V [jvm.dll+0xb93ad]
C [awt.dll+0x730c4] Java_java_awt_Container_initIDs+0x88
C [awt.dll+0x92739] Java_sun_awt_windows_WToolkit_init+0x14e9
C [awt.dll+0x7b26d] Java_sun_awt_windows_WFontMetrics_charsWidth+0x790
C [awt.dll+0x6fd55] Java_sun_awt_windows_WComponentPeer_setZOrder+0x33a
C [USER32.dll+0x162fa] gapfnScSendMessage+0x332
C [USER32.dll+0x16d3a] GetThreadDesktop+0xd7
C [USER32.dll+0x20d27] GetClientRect+0xc5
C [USER32.dll+0x20d4d] CallWindowProcW+0x1b
C [awt.dll+0xaf3d3] Java_sun_awt_windows_ThemeReader_isGetThemeTransitionDurationDefined+0xcb
C [COMCTL32.dll+0x2f5ee] DefSubclassProc+0x92

Registers:
EAX=0x0030ec30, EBX=0x04d5ba28, ECX=0x0030ec30, EDX=0x0030f01c
ESP=0x04feefd0, EBP=0x04feefe0, ESI=0x00000000, EDI=0x00000030
EIP=0x49151000, EFLAGS=0x00010246

Top of Stack: (sp=0x04feefd0)
0x04feefd0: 6924a4f9 00000030 0030ec30 04d60c00
0x04feefe0: 04fef138 691bd7a7 00000004 04d60c00
0x04feeff0: 04fef150 00000000 000000a0 04d60c00
0x04fef000: 00000011 00000004 00000003 00000000
0x04fef010: 00000000 00000004 00000003 0030ec28
0x04fef020: 0030ec30 0030f01c 00000004 00000006
0x04fef030: 04d60d28 00000000 00000000 00000000
0x04fef040: 00000000 00000001 00000016 00000000

Instructions: (pc=0x49151000)
0x49150fe0:
[error occurred during error reporting (printing registers, top of stack, instructions near pc), id 0xc0000005]

Register to memory mapping:

EAX=0x0030ec30 is an unknown value
EBX=0x04d5ba28 is an unknown value
ECX=0x0030ec30 is an unknown value
EDX=0x0030f01c is an unknown value
ESP=0x04feefd0 is pointing into the stack for thread: 0x04d60c00
EBP=0x04feefe0 is pointing into the stack for thread: 0x04d60c00
ESI=0x00000000 is an unknown value
EDI=0x00000030 is an unknown value

Stack: [0x04fa0000,0x04ff0000], sp=0x04feefd0, free space=315k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C 0x49151000
V [jvm.dll+0xdd7a7]
J java.security.AccessController.getStackAccessControlContext()Ljava/security/AccessControlContext;
J java.awt.AWTEvent.(Ljava/lang/Object;I)V
j sun.awt.GlobalCursorManager.updateCursorLater(Ljava/awt/Component;)V+16
j sun.awt.windows.WGlobalCursorManager.nativeUpdateCursor(Ljava/awt/Component;)V+4
v ~StubRoutines::call_stub
V [jvm.dll+0x12a39a]
V [jvm.dll+0x1d978e]
V [jvm.dll+0x12a41d]
V [jvm.dll+0xaee94]
V [jvm.dll+0xb93ad]
C [awt.dll+0x730c4] Java_java_awt_Container_initIDs+0x88
C [awt.dll+0x92739] Java_sun_awt_windows_WToolkit_init+0x14e9
C [awt.dll+0x7b26d] Java_sun_awt_windows_WFontMetrics_charsWidth+0x790
C [awt.dll+0x6fd55] Java_sun_awt_windows_WComponentPeer_setZOrder+0x33a
C [USER32.dll+0x162fa] gapfnScSendMessage+0x332
C [USER32.dll+0x16d3a] GetThreadDesktop+0xd7
C [USER32.dll+0x20d27] GetClientRect+0xc5
C [USER32.dll+0x20d4d] CallWindowProcW+0x1b
C [awt.dll+0xaf3d3] Java_sun_awt_windows_ThemeReader_isGetThemeTransitionDurationDefined+0xcb
C [COMCTL32.dll+0x2f5ee] DefSubclassProc+0x92

$(document).ready(function(){
	$('#orig').bind("scroll", function(){
		$('#compare').scrollTop($(this).scrollTop());
		$('#compare').scrollLeft($(this).scrollLeft());
	});
	$('#compare').bind("scroll", function(){
		$('#orig').scrollTop($(this).scrollTop());
		$('#orig').scrollLeft($(this).scrollLeft());
	});
});

이렇게 하면 한쪽만 이동해도 다른 한쪽도 같은 위치로 이동하게 된다.

만약 두 div의 내용이 달라서 높이가 다르면 더 짧은쪽을 기준으로 움직이게 된다.

댓글 남기기