如何禁止自己的页面在别人的框架里打开
把以下代码加至你的<head>区
<script>
if (window.top!=self){
window.top.location=self.location
}
</script>
英文排版的问题:怎么能让英文自动排列整齐
请使用css中的
text-align: justify;
HTML 代码片段如下:
<table style="TABLE-LAYOUT: fixed" width="100%" border="0" cellspacing="0" cellpadding="7" bgcolor="#f7f7f7">
<tr>
<td style="LEFT: 0px; WIDTH: 100%; text-align: justify"><font color="#990000">[效果]</font><br>
who are you you are a aaa is it comprehention who are you you are a pig is it comprehention
who are you you are a aaa is it comprehention
who are you you are a aaa is it comprehention
</font></td>
</tr>
</table>
保持layer在最前面,而不被Iframe、Object所覆盖
只要在Layer中再插Iframe 或 Object 设z-Index值
HTML 代码片段如下:
<div z-Index:2><object xxx></object></div> # 前面
<div z-Index:1><object xxx></object></div> # 后面
<div id="Layer2" style="position:absolute; top:40;width:400px; height:95px;z-index:2"><table height=100% width=100% bgcolor="#ff0000"><tr><td height=100% width=100%></td></tr></table><iframe width=0 height=0></iframe></div>
<div id="Layer1" style="position:absolute; top:50;width:200px; height:115px;z-index:1"><iframe height=100% width=100%></iframe></div>
请问怎么在网页中改变鼠标的箭头形状
HTML 代码片段如下:
<body>
<a href="#" style="cursor: auto;">auto</a><br>
<a href="#" style="cursor: crosshair ">crosshair </a><br>
<a href="#" style="cursor: default ">default </a><br>
<a href="#" style="cursor: hand ">hand </a><br>
<a href="#" style="cursor: move ">move </a><br>
<a href="#" style="cursor: e-resize ">e-resize </a><br>
<a href="#" style="cursor: ne-resize ">ne-resize </a><br>
<a href="#" style="cursor: nw-resize">nw-resize</a><br>
<a href="#" style="cursor: n-resize">n-resize</a><br>
<a href="#" style="cursor: se-resize">se-resize</a><br>
<a href="#" style="cursor: sw-resize">sw-resize</a><br>
<a href="#" style="cursor: s-resize">s-resize</a><br>
<a href="#" style="cursor: w-resize">w-resize</a><br>
<a href="#" style="cursor: text">text</a><br>
<a href="#" style="cursor: wait">wait</a><br>
<a href="#" style="cursor: help">help</a><br>
</body>
解释一下event.X和event.clientX有什么区别
event.clientX返回事件发生时,mouse相对于客户窗口的X坐标
event.X也一样
但是如果设置事件对象的定位属性值为relative
event.clientX不变
而event.X返回事件对象的相对于本体的坐标
event代表事件的状态,例如事件发生的的元素、鼠标的位置等等,event对象只在事件过程中才有效。
event属性:
altKey
检索ALT键的当前状态
可能的值 true为关闭
false为不关闭
button
检索按下的鼠标键
可能的值: 0 没按键
1 按左键
2 按右键
3 按左右键
4 按中间键
5 按左键和中间键 更多详细内容 »
[codes=javascript]
<script language="JavaScript">
function check(str) {
var s;
var ts;
var tscode;
for (i=0;i<str.length;i++) {
ts=str.substring(i);
tscode=charCodeAt(ts);
if ((tscode<19968)||(ts>40959)) {
alert("you must input chinese");
return false;
}
else {
return true;
}
}
}
</script> [/codes]
charCodeAt()返回字符的unicode代码。
中文字符的代码从4e00-9fff(19968-40959)
转:Javascript 屏幕宽度,IE可视宽度,及浮动广告
mark
<script>
alert(screen.width+"*"+screen.height)
</script>
—————————————————————
screen.width
—————————————————————
<script>
function centerWindow(url,w,h){
l=(screen.width-w)/2
t=(screen.height-h)/2
window.open(url,'','left='+l+',top='+t+',width='+w+',height='+h)
}
</script>
<input type=button onclick="centerWindow('about:blank',200,200)">
—————————————————————
<body>
<SCRIPT LANGUAGE="JavaScript">
var s ="网页可见区域宽:"+ document.body.clientWidth;
s+="\r\n网页可见区域高:"+ document.body.clientHeight;
s += "\r\n网页正文全文宽:"+ document.body.scrollWidth;
s += "\r\n网页正文全文高:"+ document.body.scrollHeight;
s += "\r\n网页正文部分上:"+ window.screenTop;
s += "\r\n网页正文部分左:"+ window.screenLeft;
s += "\r\n屏幕分辨率的高:"+ window.screen.height;
s += "\r\n屏幕分辨率的宽:"+ window.screen.width;
s +="\r\n屏幕可用工作区高度:"+ window.screen.availHeight;
s +="\r\n屏幕可用工作区宽度:"+ window.screen.availWidth;
alert(s);
</SCRIPT>
—————————————————————
<SCRIPT LANGUAGE="JavaScript">
<!– Begin
function redirectPage() {
/*var url640x480 = "http://www.yoursite.com/640×480.html";**记得改相应的页面*/
var url800x600 = "index1.asp";
var url1024x768 = "index2.asp";
/*if ((screen.width == 640) && (screen.height == 480))
window.location.href= url640x480;*/
if (screen.width <= 800 )
window.location.href= url800x600;
else if ((screen.width >= 1024) )
window.location.href= url1024x768;
}
// End –>
</script>
======================================
<SCRIPT FOR=window EVENT=onload LANGUAGE="JavaScript">
initAd();//载入页面后,调用函数initAd()
</SCRIPT>
<script language="JavaScript">
<!–
function initAd() {
document.all.AdLayer.style.posTop = -200;
//设置onLoad事件激发以后,广告层相对于固定后的y方向位置
document.all.AdLayer.style.visibility = 'visible'//设置层为可见
MoveLayer('AdLayer');//调用函数MoveLayer()
}
function MoveLayer(layerName) {
var x = 600;//浮动广告层固定于浏览器的x方向位置
var y = 300;//浮动广告层固定于浏览器的y方向位置
var diff = (document.body.scrollTop + y – document.all.AdLayer.style.posTop)*.40;
var y = document.body.scrollTop + y – diff;
eval("document.all." + layerName + ".style.posTop = y");
eval("document.all." + layerName + ".style.posLeft = x");//移动广告层
setTimeout("MoveLayer('AdLayer');", 20);//设置20毫秒后再调用函数MoveLayer()
}
//–>
</script>
<!–下面为一个ID为AdLayer的层(如ID名不为AdLayer,
上面MoveLayer()内的AdLayer也要作相应修改),包括一张带链接的图片–>
<div id=AdLayer style='position:absolute; width:61px; height:59px; z-index:20; visibility:hidden;; left: 600px; top: 300px'>
<script>
var YahooCNADConfig=new Array();
YahooCNADConfig['adid']=909
YahooCNADConfig['wid']=28709
YahooCNADConfig['w']=110
YahooCNADConfig['h']=300
</script>
<script type='text/javascript' src='http://view.aliunion.cn.yahoo.com/showad.php'></script>
</div>
近期评论