<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title></title> <script> /** * @param oTarget 需要加载scroll的dom对象 * @param fnHandler 处理的回调函数 */ function eventHandler(oTarget, fnHandler) { if (oTarget.addEventListener) { oTarget.addEventListener("scroll", fnHandler, false); } else if (oTarget.attachEvent) { oTarget.attachEvent("onscroll", fnHandler); } else { oTarget["onscroll"] = fnHandler; } };
function oo(divContentID, divHeaderID) { var div = document.getElementById(divContentID); var left = div.scrollLeft; var divHeader = document.getElementById(divHeaderID); divHeader.scrollLeft = left;