[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
简单的页面,可以使用这种自适应设计。
自适应网页设计(Responsive Web Design)
http://www.ruanyifeng.com/blog/2012/05/responsive_web_design.html


复杂的页面,需要判断屏幕大小,分别设计。
『千江有水千江月』千江有水,月映千江;万里无云,万里青天。    http://yu2n.qiniudn.com/

TOP

回复  ygqiang


    你到底有没有看 5 楼链接?他发的东西都已经写得那么清楚了
CrLf 发表于 2016-3-17 21:18


    网上现成的例子也有,缩放网页字体:
  1. www.jq22.com/demo/286f2b4a-484c-11e4-b680-00163e001348/
复制代码
『千江有水千江月』千江有水,月映千江;万里无云,万里青天。    http://yu2n.qiniudn.com/

TOP

楼主的代码…
我有强迫症。
  1. <HTA:APPLICATION ID="screen"
  2. APPLICATIONNAME="myApp1"
  3. contextMenu ="no"
  4. BORDER="none"
  5. innerBorder="no"
  6. SHOWINTASKBAR="yes"
  7. SINGLEINSTANCE="yes"
  8. SYSMENU="no"
  9. VERSION="1.0"
  10. WINDOWSTATE="maximize"
  11. ICON="taskmgr.exe"
  12. />
  13. <html lang="cn">
  14. <head>
  15. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  16. <script language="JavaScript" type="text/javascript">
  17. function changeFontSize() {
  18. var w = document.body.clientWidth;
  19. var h = document.body.clientHeight;
  20. var size = w/3; size2 = w/9;
  21. if (w > 2000) {
  22. size = w/3;
  23. } else  {
  24. size = w/3;
  25. }
  26. document.getElementById("curtime").style.fontSize = "" + size + "px";
  27. document.getElementById("cursec").style.fontSize = "" + size2 + "px";
  28. document.getElementById("curdate").style.fontSize = "" + size2 + "px";
  29. document.getElementById("curweek").style.fontSize = "" + size2 + "px";
  30. }
  31. function SetTimeText() {
  32. var dt1=new Date();
  33. document.getElementById("curtime").innerHTML = dt1.getHours() + ":" + ("00" + dt1.getMinutes()).slice(-2);
  34. document.getElementById("cursec").innerHTML = ("00" + dt1.getSeconds()).slice(-2);
  35. document.getElementById("curdate").innerHTML= dt1.getMonth() + "-" + dt1.getDate();
  36. document.getElementById("curweek").innerHTML = "周" + "日一二三四五六".substr(dt1.getDay(), 1);
  37. }
  38. window.onload = function(){
  39. SetTimeText();
  40. changeFontSize();
  41. setInterval(SetTimeText, 500);
  42. setInterval(changeFontSize, 1000);
  43. };
  44. function closeWindow() {
  45. try {
  46. var Shell = new ActiveXObject("Shell.Application");
  47. Shell = null;
  48. window.close();
  49. } catch(e) {}
  50. }
  51. </script>
  52. <style type="text/css">
  53. strong {display: inline}
  54. </style>
  55. </head>
  56. <body bgcolor="#000000" bordercolor="#000000" scroll="no" onclick="closeWindow()" onkeyup="closeWindow()">
  57. <table style="width:100%; height:100%; text-align:center">
  58. <tr>
  59. <td>
  60. <strong id=curtime style="font-size:400px;color:#ffffff;font-family:黑体" /></strong>
  61. <strong id=cursec style="font-size:50px;color:#ffffff;margin-left: 8px;"/></strong><br/>
  62. <strong id=curdate style="font-size:50px;color:#ffffff;font-family:黑体;margin-left: 50px;" /></strong>
  63. <strong id=curweek style="font-size:50px;color:#ffffff;font-family:黑体;margin-left: 50px;" /></strong>
  64. </td>
  65. </tr>
  66. </table>
  67. </body>
  68. </html>
复制代码
1

评分人数

    • CrLf: 强迫症技术 + 1
『千江有水千江月』千江有水,月映千江;万里无云,万里青天。    http://yu2n.qiniudn.com/

TOP

刚刚写的,试试吧。

Timer & Color
http://7i7hsj.com1.z0.glb.clouddn.com/ColorTimer.html
『千江有水千江月』千江有水,月映千江;万里无云,万里青天。    http://yu2n.qiniudn.com/

TOP

回复 20# ygqiang


    IE下面的 split() 有个BUG, 与chrome不一致:
  1. console.log('rgb(1, 2, 3)'.split(/\D+/).join(', '));
复制代码
所以导致了出错。改用 match 方法就可以了。

试试:
http://7i7hsj.com1.z0.glb.clouddn.com/ColorTimer1.html
『千江有水千江月』千江有水,月映千江;万里无云,万里青天。    http://yu2n.qiniudn.com/

TOP

回复 22# CrLf


    Windows 7 x64 IE8.0
  1. >>console.log('rgb(1, 2, 3)'.split(/\D+/).join(', '));
  2. 日志: 1, 2, 3
复制代码
『千江有水千江月』千江有水,月映千江;万里无云,万里青天。    http://yu2n.qiniudn.com/

TOP

回复 26# ygqiang


    使用记事本打开源代码,依次点击菜单上“文件”-“另存为”,在“另存为”对话框中,编码选择“utf-8”,点“保存”。
『千江有水千江月』千江有水,月映千江;万里无云,万里青天。    http://yu2n.qiniudn.com/

TOP

回复 29# ygqiang

替换CSS为:
  1. <style type="text/css">
  2. #center {position: absolute; }
  3. #center span {display: inline; font-weight:bold; font-family:SimHei,"Microsoft YaHei","Microsoft JhengHei",DFKai-SB,SimSun;}
  4. #center span #curtime,#cursec {padding:1.5%;}
  5. #center span #curdate,#curweek {padding:2%;}
  6. </style>
复制代码
完整代码:
    http://7i7hsj.com1.z0.glb.clouddn.com/ColorTimer2.html
1

评分人数

『千江有水千江月』千江有水,月映千江;万里无云,万里青天。    http://yu2n.qiniudn.com/

TOP

返回列表