我是新来的,赠送一个自编DHTML特效先!

aotianlong 2003-05-03 02:38:33

<html>
<head>
<meta charset="gb2312">
<title>超级窗口</title>
<script language="javascript">
/****************************超级窗口***************************
傲天龙写于2003.5.3 QQ:12701586 EMAIL:aotianlong@2911.net


目前已经完成:
1.双击标题最大化跟还原
2.可以随便移动
3.可以区分聚焦
4.能够自由变换窗口大小

更多其他功能,需要完善中...(等我实在没劲的时候再完成吧^__^)

****************************************************************/
var itsPosLeft,itsPosTop,itsX,itsY,itsPosWidth,itsPosHeight;
var canDrag = false;


function WindowTitle_mouseDown()
{
if(event.button==1)
{
canDrag = true;
itsX = event.clientX;
itsY = event.clientY;
}
}

var MainWindow_isFocus = false;
function MainWindow_mouseDown()
{
MainWindow_isFocus = true;
}
var bdMousedown = false;
function Body_mouseDown()
{
if(MainWindow_isFocus)
{
WindowTitle.style.backgroundColor="activecaption";
WindowTitle.style.color="captiontext";
}
else
{
WindowTitle.style.backgroundColor="inactivecaption";
WindowTitle.style.color="inactivecaptiontext";
}
MainWindow_isFocus = false;
bdMousedown = true;
itsPosLeft = MainWindow.style.posLeft;
itsPosTop = MainWindow.style.posTop;
itsPosWidth = MainWindow.style.posWidth;
itsPosHeight = MainWindow.style.posHeight;
if(canResize)
MainWindow.style.borderColor="activeborder";
}

function Body_mouseUp()
{
bdMousedown = false;
itsErrer = 2; //恢复被修改的误差值
MainWindow.style.borderColor="";
}

function WindowTitle_mouseUp()
{
canDrag = false;
canResize = false;
}

var canResize = false;
var itsErrer = 2; //设置误差,能够使得让鼠标更容易取得变形点
function Body_mouseMove()
{
//检测变形
var evtX,evtY,MWwidth,MWheight,MWleft,MWtop;
evtX = event.clientX;
evtY = event.clientY;
MWwidth = MainWindow.offsetWidth;
MWheight = MainWindow.offsetHeight;
MWleft = MainWindow.style.posLeft;
MWtop = MainWindow.style.posTop;

var isLeft,isRight,isTop,isBottom,isLeftTop,isLeftBottom,isRightTop,isRightBottom;//定义八个

位置的BOOL值




var bX,sX,bY,sY;

bX = evtX+itsErrer;
sX = evtX-itsErrer;
bY = evtY+itsErrer;
sY = evtY-itsErrer;

isRight = bX>MWwidth+MWleft&&sX<MWwidth+MWleft;
isLeft = bX>MWleft&&sX<MWleft;
isTop = bY>MWtop&&sY<MWtop;
isBottom = bY>MWtop+MWheight&&sY<MWheight+MWtop;
isLeftTop = isLeft&&isTop;
isLeftBottom = isLeft&&isBottom;
isRightTop = isRight&&isTop;
isRightBottom = isRight&&isBottom;
if(isRight||isLeft||isTop||isBottom)
{
if(isRight||isLeft)
document.body.style.cursor="w-resize";
if(isTop||isBottom)
document.body.style.cursor="n-resize";
if(isRightTop||isLeftBottom)
document.body.style.cursor="sw-resize";
if(isLeftTop||isLeftBottom)
document.body.style.cursor="nw-resize";
canResize = true;
}
else
{
document.body.style.cursor="default";
canResize = false;
}
if(canDrag) //处理拖曳
{
MainWindow.style.posLeft = itsPosLeft - itsX + event.clientX;
MainWindow.style.posTop = itsPosTop - itsY + event.clientY;
}

//处理窗口大小操作
if(bdMousedown&&canResize)
{
itsErrer = 50
if(isLeft)
{
MainWindow.style.posLeft = event.clientX;
MainWindow.style.width = itsPosWidth - event.clientX + itsPosLeft;
}
if(isRight)
{

MainWindow.style.posLeft = itsPosLeft;
MainWindow.style.width = event.clientX- itsPosLeft
}
if(isTop)
{
MainWindow.style.posTop = event.clientY;
MainWindow.style.height = itsPosHeight - event.clientY + itsPosTop;
}
if(isBottom)
{
MainWindow.style.posTop = itsPosTop;
MainWindow.style.height = event.clientY - itsPosTop;
}
}
}

var maxSize = false;
//初始化窗口的高度,宽度,跟位置,如果修改下面的值可以修改窗口的属性
var itsWidth = 400;
var itsHeight = 300;
var itsTop=0;
var itsLeft=0;
function WindowTitle_dblClick() //处理最大化跟最小化事件
{
if(!maxSize)
{
itsTop = MainWindow.style.posTop;
itsLeft = MainWindow.style.posLeft;
itsWidth = MainWindow.style.posWidth;
itsHeight = MainWindow.style.posHeight;
MainWindow.style.width = document.body.clientWidth;
MainWindow.style.height = document.body.clientHeight;
MainWindow.style.top = 0;
MainWindow.style.left = 0;
maxSize = true
}
else
{
MainWindow.style.width = itsWidth;
MainWindow.style.height = itsHeight;
MainWindow.style.top = itsTop;
MainWindow.style.left = itsLeft;
maxSize = false;
}
}
</script>
</head>
<body onselectstart="return false" onmousedown="Body_mouseDown()" onmousemove="Body_mouseMove()"

onmouseup="Body_mouseUp()">

<table border=1 cellspacing=0 width=100% id="MainWindow"

style="position:absolute;top:expression(itsTop);left:expression(itsLeft);width:expression(itsWidt

h);height:expression(itsHeight)" onmousedown="MainWindow_mouseDown()">
<tr>
<td style="background-color:activecaption;height:20px;color:captiontext" id="WindowTitle"

ondblclick="WindowTitle_dblClick()" onmousedown="WindowTitle_mouseDown()"

onmouseup="WindowTitle_mouseUp()">
<!--此处为窗口的标题-->
超级窗口</td>
</tr>
<tr>
<td valign="top" id="WindowBody">
<!--此处为窗口的正文区域-->
 

</td>
</tr>
</table>

</body>
</html>

...全文
50 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
blues-star 2003-05-05
  • 打赏
  • 举报
回复
大哥,怎么都是错误啊?晕咯
aotianlong 2003-05-05
  • 打赏
  • 举报
回复
就一个人支持呀?惨!
gOODiDEA 2003-05-04
  • 打赏
  • 举报
回复
谢谢
内容概要:本文提出了一种基于快速稀疏辅助信号分解与非凸增强技术的轴承故障诊断方法,并提供了完整的Matlab代码实现。该方法旨在从复杂的机械设备振动信号中高效、准确地提取故障特征,通过优化信号分解过程克服传统方法在噪声干扰下敏感、分辨率不足的问题,结合非凸优化策略增强微弱故障信号的辨识能力,从而提升早期故障诊断的准确性与鲁棒性。研究涵盖了算法原理、模型构建、仿真验证及结果分析,展示了其在旋转机械状态监测中的实际应用价值。; 适合人群:具备一定信号处理基础和Matlab编程能力,从事机械故障诊断、状态监测、智能运维等相关领域的科研人员及工程技术人员,尤其适合研究生和从事相关项目研发的工程师。; 使用场景及目标:①应用于旋转机械(如电机、风机、齿轮箱)的轴承早期故障检测;②用于复杂噪声环境下微弱故障信号的提取与增强;③为开发高精度智能诊断系统提供算法支持和技术参考;④辅助完成科研论文复现、毕业课题或工业项目开发。; 阅读建议:此资源以算法实现为核心,强调理论与实践结合,建议读者在学习过程中同步运行Matlab代码,深入理解信号分解与优化增强的每一步处理逻辑,并尝试在不同数据集上进行测试与调参,以掌握算法的适应性与优化技巧。

87,987

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧