- 6
- 0
- 约3.63千字
- 约 6页
- 2017-12-27 发布于河南
- 举报
鼠标拖动改变单元格大小
鼠标拖动改变单元格大小
%@ page language=java import=java.util.* pageEncoding=UTF-8%
%
String path = request.getContextPath();
String basePath = request.getScheme()+://+request.getServerName()+:+request.getServerPort()+path+/;
%
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
html
head
title鼠标拖动改变编辑表格大小/title
meta http-equiv=Content-Type content=text/html; charset=utf-8 /
SCRIPT language=javascript
var theobject = null;
function resizeObject() {
this.el = null;
this.dir = ;
this.grabx = null;
this.graby = null;
this.width = null;
this.height = null;
this.left = null;
this.top = null;
}
function getDirection(el) {
var xPos, yPos, offset, dir;
dir = ;
xPos = window.event.offsetX;
yPos = window.event.offsetY;
offset = 8; //The distance from the edge in pixels
if (yPosoffset) dir += n;
else if (yPos el.offsetHeight-offset) dir += s;
if (xPosoffset) dir += w;
else if (xPos el.offsetWidth-offset) dir += e;
return dir;
}
function doDown() {
var el = getReal(event.srcElement, className, resizeMe);
if (el == null) {
theobject = null;
return;
}
dir = getDirection(el);
if (dir == ) return;
theobject = new resizeObject();
theobject.el = el;
theobject.dir = dir;
theobject.grabx = window.event.clientX;
theobject.graby = window.event.clientY;
theobject.width = el.offsetWidth;
theobject.height = el.offsetHeight;
theobject.left = el.offsetLeft;
theobject.top = el.offsetTop;
window.event.returnValue = false;
window.event.cancelBubble = true;
}
function doUp() {
if (theobject != null) {
theobject = null;
}
}
function doMove() {
var el, xPos, yPos, str, xMin, yMin;
xMin = 8;
yMin = 8;
el = getReal(event.srcElement, className, resizeMe);
if (el.className == resizeMe) {
str = getDirection(el);
if (str == ) str = default;
else str += -resize;
el.style.cursor = str;
}
if(theobject != null) {
if (dir.indexOf(e) != -1)
theobject.el.style.width = Math.max(xMin, theobject.width + window.event.clientX - theobject.grabx) + px;
if (dir
您可能关注的文档
最近下载
- 建筑工程图集 J331、J332、G221:地沟及盖板(2009合订本).pdf VIP
- 输变电工程标准工艺(架空线路分册)2022版.pdf VIP
- 输变电工程标准工艺(变电工程电气分册)2022版.docx VIP
- 包头旭阳硅料科技有限公司年产12万吨高纯晶硅项目(一期6万吨)环评报告书.pdf VIP
- 兰州爱赛特机电科技有限公司《铝锭连续铸造机组》编制说明.pdf VIP
- SG109-1~4 民用建筑工程设计常见问题分析及图示-结构专业(2005年合订本).docx VIP
- 2025年上海公务员考试(城市建设管理)历年参考题库含答案详解.docx VIP
- 输变电工程标准工艺(电缆工程分册)2022版.docx VIP
- 2025年安徽城管协管员招聘考试(管理综合知识)历年参考题库含答案详解.docx VIP
- 喉阻塞的护理.pptx VIP
原创力文档

文档评论(0)