· 网络编程· 网页设计· 图形图像· 网站联盟· 数 据 库· 站长时代· 业界资讯· 网站运营· 黑客攻防· 电脑技巧

站长资讯 News
· ASP 专区 · PHP 专区
· JSP 专区 · NET 专区
· XML 专区 · CGI 专区
· 其他相关
热门文章
· FlashMdy快乐行
· 什么是Web3.0
· The World浏览器秘技..
· 游荡在个人网站大潮..
· ASP中Request对象获..
· 今日(2006-11-26)域..
· 实战 FastCGI_2. 安..
· 黑客入侵“在线影院..
· [图文] 认识FrontPag..
· [图文] 谢文写诗袒露..
相关文章
· 清除PWSteal.Lemir...
· Asp.Net中的脚本回调..
您当前的位置:资源库 -> 网络编程 -> NET 专区 -> 文章内容
r.a.d.controls Q2 2005中TreeView 控件遮挡问题
作者:无从考证  来源:中国软件  发布时间:2005-9-4 11:17:14  发布人:admin

减小字体 增大字体

最近做一个用r.a.d.controls Q2 2005做一个小东西,在使用TreeView控件的时候,如果弹出右键菜单的时候,遇到旁边有框架,那么就会产生遮挡现象。如下图:
chinaz.com/Files/BeyondPic/ڵ.jpg" width=375>
这一点真的很让人不舒服。后来想到这个控件的右键菜单是在客户端的脚本中的,于是打开客户端脚本文件( RadTreeView_Client_4_0_4.js )。没想到打开以后,发现所有的脚本都写在一行里面,读起来很是费劲。就想了各种办法来格式化了一下。这样看起来才好一些。找到了右键菜单的控制语句,在RadTreeView.prototype.ShowContextMenu  中 rtvG76.style.top = e.clientY + document.body.scrollTop;这一句后面加入 VerifyPosition(rtvG76) ;并在合适的位置加入VerifyPosition 函数代码。VerifyPosition 是自己以前作右键菜单时控制弹出位置的代码,弹出的时候根据左右边距,自动设定显示位置。代码如下:

chinaz.com/Files/BeyondPic/None.gif" align=top>function VerifyPosition(oLayer)
chinaz.com/Files/BeyondPic/None.gif" align=top>{
chinaz.com/Files/BeyondPic/None.gif" align=top>
chinaz.com/Files/BeyondPic/None.gif" align=top> 
var nWidth = oLayer.offsetWidth;
chinaz.com/Files/BeyondPic/None.gif" align=top> 
var nHeight = oLayer.offsetHeight;
chinaz.com/Files/BeyondPic/None.gif" align=top>
chinaz.com/Files/BeyondPic/None.gif" align=top> 
if (oLayer.style.pixelLeft + nWidth > document.body.clientWidth)
chinaz.com/Files/BeyondPic/None.gif" align=top> {
chinaz.com/Files/BeyondPic/None.gif" align=top>  oLayer.style.pixelLeft 
-= nWidth;
chinaz.com/Files/BeyondPic/None.gif" align=top>
chinaz.com/Files/BeyondPic/None.gif" align=top>  
if ( oLayer.style.pixelLeft < document.body.scrollLeft)
chinaz.com/Files/BeyondPic/None.gif" align=top>   oLayer.style.pixelLeft 
= document.body.clientWidth + document.body.scrollLeft - nWidth - 5;
chinaz.com/Files/BeyondPic/None.gif" align=top> }
chinaz.com/Files/BeyondPic/None.gif" align=top>
chinaz.com/Files/BeyondPic/None.gif" align=top> 
if (oLayer.style.pixelTop + nHeight > document.body.clientHeight)
chinaz.com/Files/BeyondPic/None.gif" align=top> {
chinaz.com/Files/BeyondPic/None.gif" align=top>  oLayer.style.pixelTop 
-= nHeight;
chinaz.com/Files/BeyondPic/None.gif" align=top>
chinaz.com/Files/BeyondPic/None.gif" align=top>  
if ( oLayer.style.pixelTop < document.body.scrollTop)
chinaz.com/Files/BeyondPic/None.gif" align=top>   oLayer.style.pixelTop 
= document.body.clientHeight + document.body.scrollTop - nHeight - 5;
chinaz.com/Files/BeyondPic/None.gif" align=top> }
chinaz.com/Files/BeyondPic/None.gif" align=top>}
chinaz.com/Files/BeyondPic/None.gif" align=top>



问题解决,效果如下:

chinaz.com/Files/BeyondPic/ڵ(1).jpg">



 
 
[] [返回上一页] [打 印]
下一篇文章:缓存类的实现(C#)