Código de efecto HTML

1. Texturas:

<img src="图片地址">

2. Únete a la conexión:

<a href="所要连接的相关地址">写上你想写的字</a>

3. Abra la conexión en una nueva ventana:

<a href="相关地址" target="_blank">写上要写的字</a>

Quite el subrayado de una conexión para abrir la conexión en una nueva ventana:

<a href="相关地址" style="text-decoration:none" target="_blank">写上你想写的字</a>

4. Fuente móvil (linterna giratoria):

<marquee>写上你想写的字</marquee>

5. Fuente en negrita:

<b>写上你想写的字</b>

6. Fuente cursiva:

<i>写上你想写的字</i>

7. Subrayado de fuente:

 <u>写上你想写的字</u>

8. Fuente tachada:

 <s>写上你想写的字</s>

9. Aumente el tamaño de la fuente:

<big>写上你想写的字</big>

10. Tamaño del control de fuente:

(El tamaño de fuente puede ser de h1-h5, h1 es el más grande y h5 es el más pequeño)

<h1>写上你想写的字</h1>

11. Cambiar color de fuente:

(donde el valor está entre 000000 y ffffff (16 dígitos)

<font color="#value">写上你想写的字</font>

12. Elimine el guión bajo de la conexión:

<a href="相关地址" style="text-decoration:none">写上你想写的字</a>

13. Publicar música:

<embed src=音乐地址 width=300 height=45 type=audio/mpeg autostart="false">

15. Pegar archivos de video:

<img dynsrc="文件地址" width="宽度" height="高度" start=mouseover>

16. Nueva línea:

<br/>

17. Párrafo:

<p>段落</p>

18. Estilo de texto original:

<pre>正文</pre>

19. Cambiar el fondo de la publicación:

<body background="背景图片地址"></body>

20. Se corrigió el fondo de la publicación que no se desplazaba con la barra de desplazamiento:

<body background="背景图片地址" bodybgproperties=fixed></body>

21. Personaliza el color de fondo de la publicación: (ver 10 para el valor)

<body bgcolor="#value"></body>

22. Publica música de fondo:

<bgsound="背景音乐地址" loop=infinite></bgsound>

23. Publica una página web:

<iframe src="相关地址" width="宽度" height="高度"></iframe>

Código de efecto HTML

1. Ignora el botón derecho

 <body οncοntextmenu="return false"> 
  或 
  <body style="overflow-y:hidden">

2. Agrega música de fondo

ES DECIR:

<bgsound src="*.mid" loop=infinite> 

NS:

.mid Un archivo en formato midi de su música de fondo

<embed src="*.mid" autostart=true hidden=true loop=true>   </embed>

3. Método simple window.open

 <a href="#"  οnclick="javascript :window.open(文件路径/文件名,newwindow,   toolbar=no,scrollbars=yes,resizable=no,top=0,left=0, width=400,height=300);">文字或图片</a> 

Explicación de parámetros:

 <SCRIPT LANGUAGE="javascript"> js脚本开始;   window.open 弹出新窗口的命令;   文件路径/文件名 弹出窗口的文件名;   newwindow 弹出窗口的名字(不是文件名),非必须,可用空代替;   width=400 窗口宽度; height=300 窗口高度;   top=0 窗口距离屏幕上方的象素值; left=0 窗口距离屏幕左侧的象素值;   toolbar=no 是否显示工具栏,yes为显示;   menubar,scrollbars 表示菜单栏和滚动栏。   resizable=no 是否允许改变窗口大小,yes为允许;   location=no 是否显示地址栏,yes为允许;   status=no 是否显示状态栏内的信息(通常是文件已经打开),yes为允许;  
</SCRIPT>

final del script js

4. Cifrado de página simple

<script LANGUAGE="javascript">   <!--   function loopy(){
      
          var sWord ="";    while(sWord!="login"){
      
      sWord=prompt("请输入你的登陆密码");}    alert("登陆成功!");   }   loopy()   //-->   
</script>

5. La imagen de fondo no se mueve cuando se tira de la página

<style>   
    body{
      
      
        background-image:url(logo.gif);   background-repeat:no-repeat;background-position:center
    }   
</style>  

6. Deje que el navegador no pueda guardar la página al guardar la página

<noscript>
    <iframe src="*.html"></iframe>
</noscript> 

7. Reemplace las imágenes al azar

<script>  
    document.write(<img src="img/+parseInt(Math.random()*(5))   +.gif"height="40" width="50">   
</script>   
图片文件名为0.gif 1.gif 2.gif 3.gif 4.gif 

8. Para cerrar la ventana a intervalos regulares, coloque el siguiente código en el área del archivo de la página web:

<script language="javascript">   function closeit() {
      
       setTimeout("self.close()",10000) //毫秒 }   </script>   
然后再在
<body>标内加入如:
    <body οnlοad="closeit()"></body>

9. La página web se cierra automáticamente

 <html> 
     <head>  
         <object id=closes type="application/x-oleobject"   classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">   
             <param name="Command" value="Close">              </object>  
     </head>   
     <body οnlοad="window.setTimeout(closes.Click(),10000)">   这个窗口会在10秒过后自动关闭,而且不会出现提示.   
     </body>  
</html>

10. Actualización automática de la página web

Entrar en la cabeza

<meta HTTP-EQUIV="Refresh" content="20"> 

Entre ellos, 20 se actualiza automáticamente después de 20 segundos y puede cambiarlo a cualquier valor.

11. Las páginas web cambian automáticamente de página

<meta HTTP-EQUIV="Refresh" CONTENT="时间(秒);URL=地址">

12. Mantenga la capa al frente, no cubierta por Iframe y Object

Inserte Iframe u objeto en la capa y establezca el valor del índice z

<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"> height=100% width=100%>   
         <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>

13. Volver a la página anterior

<a href=javascript :history.back(1)>
    『返回上一页』
</a> 

14. Cierra la ventana

<a href=javascript :self.close()>『关闭窗口』</a> 

15. Sobre el fondo transparente de iframe

<iframe ID="iFrame1" SRC="iframe.htm"   allowTransparency="true"   style="background-color: green">
</iframe> 

16. Protege completamente el botón derecho del mouse

 <table border οncοntextmenu=return(false)><td>no</table> 可用于Table

Disponible para Mesa

17. Deseleccionar, evitar copiar

<body onselectstart="return false">

18. No pegar

οnpaste="return false"

19. Prevención de copias

 οncοpy="return false;" oncut="return false;" 

20. Reemplace la barra de direcciones de IE con su propio ícono

<link rel="Shortcut Icon" href="favicon.ico">

21. Puedes mostrar tu icono en favoritos

<link rel="Bookmark" href="favicon.ico"> 

22. Cerrar el método de entrada

<input style="ime-mode:disabled"> 

23. Usa siempre un marco

<script language="JavaScript">
    <!-- 
if (window == top)top.location.href = "frames.htm"; //frames.htm为框架网页 
// -->
</script>

24. Evita ser incriminado

<script LANGUAGE=JAVASCRIPT>
    <!-- if        (top.location!=self.location)top.location=self.location; 
// -->
</script>

25. Las páginas web no se guardarán como

<noscript>
    <iframe src=*.html></iframe>
</noscript>

26. Ver el código fuente de la página web

<input type=button value=查看网页源代码 οnclick="window.location = "view-source:"+ "http://www.pconline.com.cn"">

27. Confirmar al eliminar

<a href="javascript :if(confirm("确实要删除吗?"))location="boos.asp? &areyou=删除&page=1"">删除</a>

28. Teclas de función de escudo Shift, Alt, Ctrl

<script> 
function look(){
      
       
if(event.shiftKey) 
alert("禁止按Shift键!"); //可以换成ALT CTRL 
} 
document.οnkeydοwn=look; 
</script>

29. Las páginas web no se almacenan en caché

<META HTTP-EQUIV="pragma" CONTENT="no-cache"> 
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate"> 
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT"> 
或者<META HTTP-EQUIV="expires" CONTENT="0">

30. ¿Cómo hacer que el formulario no tenga baches?

<textarea>
<input type=text style="border:1 solid #000000"><input type=text style="border-left:none; border-right:none; border -top:none; border-bottom: 1 solid #000000">
</textarea>

31. ¿Sin barras de desplazamiento?

让竖条没有: 
<body style="overflow:scroll;overflow-y:hidden"> 
</body> 

让横条没有: 
<body style="overflow:scroll;overflow-x:hidden"> 
</body> 

两个都去掉?更简单了 
<body scroll="no"> </body>

32. ¿Cómo eliminar la línea punteada alrededor de la imagen después de hacer clic en el enlace de la imagen?

<a href="#" onFocus="this.blur()">
    <img src="logo.jpg" border=0>
</a>

33. Formulario de envío de procesamiento de correo electrónico

<form name="form1" method="post" action="mailt****@***.com" enctype="text/plain"> 
<input type=submit> 
</form>

34. ¿Cómo escribir el código para actualizar la ventana principal en la ventana secundaria abierta?

window.opener.location.reload()

35. Cómo establecer el tamaño de la página abierta

<body οnlοad="top.resizeTo(300,200);"> 
打开页面的位置
<body οnlοad="top.moveBy(300,200);">

36. Cómo agregar una imagen de fondo que no esté llena a la página y que la imagen de fondo no se mueva cuando se tira de la página

<style> 
body 
{
      
      background-image:url(logo.gif); background-repeat:no-repeat; 
background-position:center;background-attachment: fixed} 
</style>

37. Comprueba si una cadena está compuesta enteramente por números

<script language="Javascript">
    <!-- 
function checkNum(str){
      
      return str.match(//D/)==null} 
alert(checkNum("1232142141")) 
alert(checkNum("123214214a1")) 
// -->
   </script>

38. Obtén el tamaño de una ventana

document.body.clientWidth; document.body.clientHeight

39. Cómo juzgar si es un personaje

if (/[^/x00-/xff]/g.test(s)) alert("含有汉字"); 
else alert("全是字符");

40. ¿Cuántas líneas de texto adaptativo textarea

<textarea rows=1 name=s1 cols=27 onpropertychange="this.style.posHeight=this.scrollHeight"> 
</textarea>

41. La fecha menos los días es igual a la segunda fecha

<script language=Javascript> 
function cc(dd,dadd) 
{
      
       
//可以加上错误处理 
var a = new Date(dd) 
a = a.valueOf() 
a = a - dadd * 24 * 60 * 60 * 1000 
a = new Date(a) 
alert(a.getFullYear() + "年" + (a.getMonth() + 1) + "月" + a.getDate() + "日") 
} cc("12/23/2002",2) 
</script>

42. Qué radio se selecciona

<HTML>
    <script language="vbscript"> 
function checkme() 
for each ob in radio1 
if ob.checked then window.alert ob.value 
next 
end function 
</script>
    <BODY> 
<INPUT name="radio1" type="radio" value="style" checked>Style 
<INPUT name="radio1" type="radio" value="barcode">Barcode 
<INPUT type="button" value="check" οnclick="checkme()"> 
    </BODY>
</HTML>

43. Los guiones nunca salen mal

<SCRIPT LANGUAGE="JavaScript"> 
<!-- Hide function killErrors(){
      
      return true;} window.onerror = killErrors; // --> 
</SCRIPT>

44. La tecla ENTER puede mover el cursor al siguiente cuadro de entrada

<input οnkeydοwn="if(event.keyCode==13)event.keyCode=9">

45. Comprueba la velocidad de enlace de un sitio web:

Agregue el siguiente código al campo:

<script language=Javascript> 
tim=1 
setInterval("tim++",100) 
b=1 
var autourl=new Array() 
autourl[1]="www.njcatv.net" 
autourl[2]="javacool.3322.net" 
autourl[3]="www.sina.com.cn" 
autourl[4]="www.nuaa.edu.cn" 
autourl[5]="www.cctv.com" 
function butt(){
      
       
document.write("<form name=autof>") 
for(var i=1;i<autourl.length;i++) 
document.write("<input type=text name=txt"+i+" size=10 value=测试中
……> =<input type=text 
name=url"+i+" size=40> =<input type=button value=GO

οnclick=window.open(this.form.url"+i+".value)><br>") 
document.write("<input type=submit value=刷新></form>") 
} 
butt() 
function auto(url){
      
       
document.forms[0]["url"+b].value=url 
if(tim>200) 
{
      
      document.forms[0]["txt"+b].value="链接超时"} 
else 
{
      
      document.forms[0]["txt"+b].value="时间"+tim/10+"秒"} b++ } 
function run(){
      
      for(var i=1;i<autourl.length;i++)document.write("<img src=http://"+autourl+"/"+Math.random()+" width=1 height=1 nerror=auto("http://"+autourl+"")>")} 
run()</script>

46. ​​Varios estilos de cursores

cursor su valor

automático: cursor estándar
predeterminado: flecha estándar
mano: cursor de mano
esperar: esperar
texto del cursor: I-cursor
texto-vertical: I-cursor horizontal
no-drop: cursor no arrastrable
no permitido: cursor inválido
ayuda: ? ayuda cursor
all- scroll : marca de dirección del triángulo
mover: mover marca
cruz: marca de cruz
e-cambiar tamaño
n-cambiar tamaño
nw-cambiar tamaño
w-cambiar tamaño
s-cambiar tamaño
se-cambiar tamaño
sw-cambiar tamaño

47. Prohibir el botón derecho del ratón,

Configure todas las imágenes de Demo como fondo de la mesa, y el tamaño de la mesa es el mismo que el tamaño de la imagen. Hacerlo tiene el mismo aspecto, principalmente para evitar que aparezca el botón Guardar cuando el mouse pasa sobre la imagen. El código para deshabilitar el botón derecho del mouse es simple:

<script LANGUAGE="JavaScript"> 
function click() { if (event.button==2) 
{alert(呵呵,不好意思,你甭想使用右键下载图片:)); } } document.οnmοusedοwn=click
</script>

48. Escudo de la tecla PrintScreen

Agregue el siguiente código en la sección Head de la página web. La función principal de este código es bloquear el botón PrintScreen, borrar constantemente el portapapeles y evitar que las imágenes se usen en el menú Guardar como archivo.

<script language="javascript">
<!--function testclip(){
      
      
      try {
      
      
  if(clipboardData.getData("Text")||clipboardData.getData("HTML")||clipboardData.getData("URL")) 
        {
      
      
    null;
             }
}
catch(e){
      
      
     clipboardData.setData("Text","")
}
     setTimeout("testclip()",500)
}
testclip();
//-->
</script>

49. Obtener la posición absoluta del control

<script language="javascript">
function getIE(E){
      
      
var t=e.offsetTop;
var l=e.offsetLeft;
while(e=e.offsetParent){
      
      
t+=e.offsetTop;
l+=e.offsetLeft;
}
alert("top="+t+"/nleft="+l);
}
</script>

Supongo que te gusta

Origin blog.csdn.net/weixin_48352984/article/details/126650729
Recomendado
Clasificación