使用htc导致Internet Explorer 无法打开Internet站点http://localhost/Test/index.aspx 已终止操作 ?...

htc内容:
<!--grid.htc文件:
/**
 * <p>Title: dataGrid在页面拖动行(在表头,用htc文件实现)</p>
 * <p>Description: dataGrid在页面拖动行(在表头,用htc文件实现)</p>
 * <p>Copyright: 2005-2005 by mail_ricklee Corporation</p>
 * <p>Company: mail_ricklee Corporation</p>
 * <p>CreateTime: 2005-04-23 21:30</p>
 * <p>ModifyTime:                 </p>
 * @CreateAuthor 李淼    * @version 1.0
 * @ModifyAuthor         * @version 1.0
 */-->
<PUBLIC:COMPONENT>
 <PUBLIC:ATTACH EVENT="oncontentready"   ONEVENT="fnInit()"   />
 <PUBLIC:ATTACH EVENT="onclick"   ONEVENT="fnClick()"   />
 <METHOD NAME="menubarpush"/>
 <SCRIPT LANGUAGE="JScript">
  function fnInit()
    {
   for(var i=0;i<element.rows.length;i++)
   {
    var _tr = element.rows[i];
    for(var j=0;j<_tr.cells.length;j++)
    {
     if(i==0)
     {
      _tr.attachEvent("onmousedown", fnMousedown);
      _tr.attachEvent("onmousemove",fnMousemove);
      _tr.attachEvent("onmouseover",fnMouseover);
      _tr.attachEvent("onselectstart",fnCancel);
      window.document.attachEvent("onmouseup", fnMouseup);
      window.document.attachEvent("onmousemove",fnMouseMove);
     }
    }

   }
   var _line = window.document.createElement("DIV");
   _line.style.position = "absolute";
   _line.style.backgroundColor="Silver";
   _line.style.width=1;
   window.document.body.appendChild(_line);
   element.splitLine = _line;
   element.splitLine.style.display = "none";
    }
  function fnMouseover()
  {
   return;
  }
  function fnMouseMove(){
   if(!element.splitlocked) return;
   fnMousemove(); 
  }
  function fnMousemove(){
   var oEl = event.srcElement;
   element.splitLine.style.left = window.event.x;
   element.splitLine.style.top = getTop(element);
   element.splitLine.style.height = element.parentElement.clientHeight;
   if(element.splitlocked) return;
   if(!IfSplitLocation(oEl)) return;
  }
  function fnClick(){
   var oEl = event.srcElement;
  }
  function fnMousedown(){
   var oEl = event.srcElement;
   if(!IfSplitLocation(oEl)) return;
   element.splitLine.style.display = "";
   element.splitlocked  = true;
   window.document.attachEvent("onselectstart",fnCancel);
  }
  function fnMouseup()
  {
   element.splitLine.style.display = "none";
   element.splitlocked  = false;
   element.document.body.style.cursor='default';
   if(element.curResizeTD == null) return;
   var otd = element.curResizeTD;
   var otdLeft = getLeft(otd);
   var otdwidth =  element.splitLine.style.pixelLeft - otdLeft
   if(otdwidth < 0) return;
   otd.style.width = otdwidth;
   window.document.detachEvent("onselectstart",fnCancel);
  }
  function IfSplitLocation(oEl)
  {
   if(oEl.tagName == "DIV")
    oEl = oEl.parentElement;
   if(oEl.tagName == "TD")
   {
    if(Math.abs(event.offsetX - oEl.clientWidth) <= 5)
    {
     element.curResizeTD = oEl;
     element.document.body.style.cursor='col-resize';
    }
    else if (Math.abs(event.offsetX) <= 5 && oEl.cellIndex>0){
     if(oEl.cellIndex>0){
      element.curResizeTD = oEl.parentElement.cells(oEl.cellIndex-1);
      element.document.body.style.cursor='col-resize';
     }
    }
    else{
     element.curResizeTD = null;
     element.document.body.style.cursor='default';
     return false;
    }
   }
   return true;
  }
  function getTop(e){
   var t=e.offsetTop;
   while(e=e.offsetParent){
    t+=e.offsetTop;
    }
   return t;
  }
  function getLeft(e){
   var l=e.offsetLeft;
   while(e=e.offsetParent){
    l+=e.offsetLeft;
    }
   return l;
  }
    function fnCancel()
    {
      window.event.returnValue = false;
   return false;
  }
   </SCRIPT>
</PUBLIC:COMPONENT>

转载于:https://www.cnblogs.com/deadshot123/archive/2006/12/18/595686.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值