找回密碼
 註冊
搜索
查看: 2254|回復: 5

[教學] java範例文字跑出

[複製鏈接]
發表於 2009-5-23 16:15:38 | 顯示全部樓層 |閱讀模式
 
Push to Facebook
<body>中加入onload="position_at_top();expand()"將以下程式碼拷貝到網頁原始檔<body> 與 </body> 之間 , 選個適合處貼上 。



  1. <div style="position:absolute;top:200;left:0" id="test"></div>

  2. <script>

  3. var themessage="要填ㄉ字請填這~"
  4. var fontsize=10
  5. var appearfor=3000

  6. function position_at_top(){
  7. if (document.layers)
  8. document.test.top=pageYOffset
  9. else if (document.all){
  10. test.innerHTML='<div align=center><font face="Arial">'+themessage+'</font></div>'
  11. //setTimeout("test.style.top=document.body.scrollTop",100)
  12. setTimeout("test.style.top=200",100)
  13. }
  14. }

  15. function expand(){
  16. if (document.layers){
  17. document.test.document.write('<div align=center style="font-size:'+fontsize+'px"><font face="Arial">'+themessage+'</font></div>')
  18. document.test.document.close()
  19. }
  20. else if (document.all)
  21. test.style.fontSize=fontsize+'px'
  22. fontsize+=5
  23. if (fontsize>90){
  24. if (document.layers)
  25. setTimeout("document.test.visibility='hide'",appearfor)
  26. else if (document.all)
  27. setTimeout("test.style.visibility='hidden'",appearfor)
  28. return
  29. }
  30. else
  31. setTimeout("expand()",50)
  32. }

  33. </script>
複製代碼
 
發表於 2011-6-4 00:18:27 | 顯示全部樓層
謝謝哦  
版主招募中
發表於 2011-6-4 00:20:42 | 顯示全部樓層
我想要~~~~~~~  
發表於 2011-7-16 00:40:52 | 顯示全部樓層
哈哈,看的人少,回一下  
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

Archiver|手機版|小黑屋|TShopping

GMT+8, 2025-4-30 22:51 , Processed in 0.023032 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回復 返回頂部 返回列表