当前位置:编程学习 > JS >>

js特效

1,禁止查看源码:
 
 
<span style="font-size:18px"><SCRIPT language=javascript>  
function click() {if (event.button==2) {alert('不许你偷看!');}}document.onmousedown=click  
</SCRIPT> </span>  

 

 
 
2,分时问候:
 
 
<script language="javaScript">  
<!--  
now = new Date(),hour = now.getHours()  
if(hour < 6){document.write("凌晨好!")}  
else if (hour < 9){document.write("早上好!")}  
else if (hour < 12){document.write("上午好!")}  
else if (hour < 14){document.write("中午好!")}  
else if (hour < 17){document.write("下午好!")}  
else if (hour < 19){document.write("傍晚好!")}  
else if (hour < 22){document.write("晚上好!")}  
else {document.write("夜里好!")}  
// -->  
</script>  

 

 
补充:web前端 , JavaScript ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,