拖动table边框,改变table形状,纯javascript代码

本文介绍如何通过JavaScript实现拖动表格边框以改变表格大小的功能,纯JavaScript实现,无需依赖其他库。通过监听鼠标事件,动态计算并更新表格的border属性,支持滚动条情况下的调整。
摘要由CSDN通过智能技术生成

 

< html >        
  
< head >    
  
< title > 1111 </ title >    
  
< meta  content ="text/html; charset=gb2312"  http-equiv ="Content-Type" >    
  
< style >  {    
  box-sizing
: border-box; moz-box-sizing: border-box   
  
}
   
  #testDiv 
{  
   background-color
: buttonface; 
   background-repeat
: repeat;     
    background-attachment
: scroll; 
    color
: #3969A5; 
    height
: 300px;     
    left
: 30px; 
    overflow
: hidden; 
    width
: 500; 
    z-index
: 2;     
    border
: 2px outset white; 
    margin
: 0px; 
    padding
: 2px;     
    background-position
: 0% 50% 
  
}
   
  body 
{    
   font-family
: Verdana; 
   font-size
: 9pt   
  
}
   
  #innerNice 
{    
   background-color
: white; 
   background-repeat
: repeat;   
   background-attachment
: scroll;   
   color
: #3969A5;   
   height
: 100%;   
   overflow
: auto;   
   width
: 100%;   
   border
: 2px inset white;   
   padding
: 8px;     
    background-position
: 0% 50%   
  
}
   
  
</ style >
         
  
< SCRIPT  language =javascript >      
  
var theobject = null//This gets a value as soon as a resize start   
    
  
function resizeObject() {   
   
this.el = null//pointer to the object   
   this.dir = ""//type of current resize (n, s, e, w, ne, nw, se, sw)   
   this.grabx = null//Some useful values   
   this.graby = null;   
   
this.width = null;   
   
this.height = null;   
   
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值