|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
java也能做一些底层语言开发做的事情(难度很高,不是java顶尖高手是做不来的),技能//盘算内容宽和高</STRONG><SCRIPTlanguage="javascript">
functiontest(obj)
{
varrange=obj.createTextRange();
alert("内容区宽度:"+range.boundingWidth
+"px
内容区高度:"+range.boundingHeight+"px");
}
</SCRIPT>
<BODY>
<Textareaid="txt"height="150">sdf</textarea><INPUTtype="button"value="盘算内容宽度">
</BODY><P>//无形式的提醒框functionmodelessAlert(Msg)
{
window.showModelessDialog("javascript:alert(""+escape(Msg)+"");window.close();","","status:no;resizable:no;help:no;dialogHeight:height:30px;dialogHeight:40px;");
}
//屏障按键
<html>
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312">
<noscript><metahttp-equiv="refresh"content="0;url=about:noscript"></noscript>
<title>屏障鼠标右键、Ctrl+N、Shift+F10、Alt+F4、F11、F5革新、退格键</title>
</head>
<body>
<scriptlanguage="Javascript"><!--
//屏障鼠标右键、Ctrl+N、Shift+F10、F11、F5革新、退格键
//Author:meizz(梅花雨)2002-6-18
functiondocument.oncontextmenu(){event.returnValue=false;}//屏障鼠标右键
functionwindow.onhelp(){returnfalse}//屏障F1匡助
functiondocument.onkeydown()
{
if((window.event.altKey)&&
((window.event.keyCode==37)||//屏障Alt+偏向键←
(window.event.keyCode==39)))//屏障Alt+偏向键→
{
alert("禁绝你利用ALT+偏向键行进或前进网页!");
event.returnValue=false;
}
/*注:这还不是真正地屏障Alt+偏向键,
由于Alt+偏向键弹出告诫框时,按住Alt键不放,
用鼠标点失落告诫框,这类屏障办法就生效了。今后若
有哪位妙手有真正屏障Alt键的办法,请告诉。*/
if((event.keyCode==8)||//屏障退格删除键
(event.keyCode==116)||//屏障F5革新键
(event.ctrlKey&&event.keyCode==82)){//Ctrl+R
event.keyCode=0;
event.returnValue=false;
}
if(event.keyCode==122){event.keyCode=0;event.returnValue=false;}//屏障F11
if(event.ctrlKey&&event.keyCode==78)event.returnValue=false;//屏障Ctrl+n
if(event.shiftKey&&event.keyCode==121)event.returnValue=false;//屏障shift+F10
if(window.event.srcElement.tagName=="A"&&window.event.shiftKey)
window.event.returnValue=false;//屏障shift加鼠标左键新开一网页
if((window.event.altKey)&&(window.event.keyCode==115))//屏障Alt+F4
{
window.showModelessDialog("about:blank","","dialogWidth:1px;dialogheight:1px");
returnfalse;
}
}
</script>
屏障鼠标右键、Ctrl+N、Shift+F10、Alt+F4、F11、F5革新、退格键
</body>
</html>//屏障打印
<style>
@mediaprint{
*{display:none}
}
</style>
//挪动的图层,拖动
</STRONG>
1.<spanstyle=position:absolute;width:200;height:200;background:redonmousedown=MouseDown(this)onmousemove=MouseMove()onmouseup=MouseUp()>meizz</span>
<scriptlanguage=javascript>
varObj;
functionMouseDown(obj)
{
Obj=obj;
Obj.setCapture();
Obj.l=event.x-Obj.style.pixelLeft;
Obj.t=event.y-Obj.style.pixelTop;
}
functionMouseMove()
{
if(Obj!=null)
{
Obj.style.left=event.x-Obj.l;
Obj.style.top=event.y-Obj.t;
}
}
functionMouseUp()
{
if(Obj!=null)
{
Obj.releaseCapture();
Obj=null;
}
}
</script>
2.
<divid="myDiv"src="http://www.163design.net/j/e/logo.gif"ondrag="doDrag();"style="position:absolute;left=100;top=100;">
<ahref="#"><h1>wlecome</h1></a>
</div>
<scriptlanguage="JavaScript"type="text/javascript">
varorgMouseX;
varorgMouseY;
varorgObjX;
varorgObjY;
functiondoDrag()
{
varmyObject=document.all.myDiv;
varx=event.clientX;
vary=event.clientY;
myObject.style.left=x-(orgMouseX-orgObjX);
myObject.style.top=y-(orgMouseY-orgObjY);
}
functiondoMouseDown()
{
orgMouseX=event.clientX;
orgMouseY=event.clientY;
orgObjX=parseInt(document.all.myDiv.style.left);
orgObjY=parseInt(document.all.myDiv.style.top);
}
</script>
//文档形态改动
<iframesrc="a.html"id="f"name="f"scrolling="no"frameborder=0marginwidth=0marginheight=0></iframe>
<script>
vardoc=window.frames["f"].document;
functions(){
if(doc.readyState=="complete"){
document.all.f.style.height=doc.body.scrollHeight
document.all.f.style.width=doc.body.scrollWidth
}
}
doc.onreadystatechange=s
</script>
对于一个大型项目,如果用java来作,可能需要9个月,并且可能需要翻阅10本以上的书,但如果用ruby来作,3个月,3本书就足够了,而.net也不过3,4本书足以,这就是区别。 |
|