Windows工作列上顯示網頁的超酷玩法!!!!!!!!!!!

來源:互聯網
上載者:User

Windows工作列上顯示網頁的超酷玩法!!!!!!!!!!!
作者:lee1892 -----------整理者:lnboy

眾所周知,windows的工作列可以顯示一個被稱為QuickLaunch的快捷工具按鈕欄,也可以添加一個指定的目錄,並顯示該目錄下所有檔案的按鈕。
可您是否知道它還能顯示一個html檔案的內容嗎?它確實可以!
您能想象這有什麼作用嗎?很有意思的,一起來看看吧。

在工作列上右鍵 -> 工具列 ->新工具列..
javascript:window.location.replace("file:///D:/ToolBar/Time/index.html")
--------------------------------------------------------------------------------
(此處以位於D:\ToolBar\Time目錄下名為index.html的檔案為例,此檔案稍後給出),這時在Taskbar上會出現java script:window.location等等字樣,右鍵於該字樣並重新整理之,又可能出現server not found之類的字樣,繼續右鍵並重新整理之,應該出現該html檔案的標題了,調整一下此欄的寬度就可以看到它的內容了。重新整理期間,可能會有諸如許可權限制之類的對話方塊跳出,一律yes之。強調一下,是重新整理兩次。(重新整理的時候可能會提示指令碼有錯,不用理它,多重新整理幾次就好了)

以下是前述的Time的HTML的源檔案
代碼:--------------------------------------------------------------------------------<!-- Time-->
<html>
<head>
<title>Time</title>
<style>
body { border: 0; background-color: buttonface; color: black; margin: 3px,0,0,0 }
.clocktxt { font-family: Arial; font-weight: normal; font-size: 8pt }
#btnsd { border: 2px groove white; background-color: buttonface; font-family: verdana; font-size: 9px }
</style>
<script language="JavaScript">
//Clock Script
var showclock;

function init(){
showdate()
showclock=true;
}

function showdate(){
//edit refresh rate here
var refreshrate=1000;

var Clock=new Date()
var hours=Clock.getHours()
var minutes=Clock.getMinutes()
var seconds=Clock.getSeconds()

var dn="AM"
if (hours>12){
dn="PM"
hours=hours-12
}

if (hours==0) hours=12
if (minutes<=9) minutes= "0" + minutes
if (seconds<=9) seconds= "0" + seconds

//edit format here
format = hours+":"+minutes+":"+seconds+" "+dn;

Time.innerHTML=format;

if (showclock==false) Time.innerHTML="<input type='button' value='Sh.time' id='btnsd' title='Show time'>"
else
setTimeout("showdate()",refreshrate)
}
</script>
</head>
<body scroll="no" onLoad="init()">
<center>
<font class="clocktxt"> <span id="Time" style="position:center;"></span></font>
</body>
</html>
這樣,你就可以在工作列看到一個時間的顯示了。

OK,我們已經知道如何在工作列上顯示HTML檔案了。接下來我想您一定知道如何把它拖到邊上吧,就是用滑鼠點住標題先拖到案頭上,變成一個視窗,再往螢幕邊上拖,這樣就變成一個Sidebar樂。您可以設定是否自動隱藏、是否永遠在最上端等。

在給出幾個例子前,先說說寫這種HTML的一些小訣竅。
1. 顯示與工作列顏色相同的背景色
在<head>段裡加入

代碼:--------------------------------------------------------------------------------<Style> body { border-width : 0 ; background-color: buttonface; ... }</Style>--------------------------------------------------------------------------------
這樣當更換Theme時,回一同更換

2. 自動重新整理頁面
有些情況下會希望網頁自動重新整理,可以在<head>段裡加入
代碼:--------------------------------------------------------------------------------<meta http-equiv="Refresh" content="60">--------------------------------------------------------------------------------
content的數字應該是秒吧(記不清了,呵呵)

3. 禁止捲軸

代碼:--------------------------------------------------------------------------------<body scroll="no">--------------------------------------------------------------------------------

4. 設定頁面的邊距
在body的style設定裡加入
代碼:-------------------------------------------------------------------------------- margin: 2,2,2,2 --------------------------------------------------------------------------------

差點忘了說,我的機子上,必須在工作列上加新的,也就是說每加一個新的必須從頭做起(在工作列上右鍵...拖到案頭再拖到邊上),不知道您得是否也這樣

下面是幾個樣本的部分代碼:

樣本一: 萬年曆

代碼:--------------------------------------------------------------------------------HTML QuickLaunch ///

Calendar by Lee1892
Original file from http://hohula.myetang.com/html/calendar.html

java script:window.location.replace("file:///x:/.../Calendar/index.html")

You can change the rows 1246-1262 to hide or show some parts.
for example to hide part WorldTime, change line 1246 and 1247
original:
WorldTime.style.visibility='visible' //'hidden'
WorldTime.style.position='relative' //'absolute'
change to:
WorldTime.style.visibility='hidden' //'visible'
WorldTime.style.position='absolute' //'relative'
You must know the word after // is only comments in JS:)

樣本二: 中華網即時滾動新聞

代碼:--------------------------------------------------------------------------------HTML QuickLaunch ///

China News by Lee1892

java script:window.location.replace("file:///x:/.../ChinaNews/index.html")

You can change the news you want to show at line 41
original:
<script language="JavaScript" src="http://app0.china.com/freecode/out.php?typeid
=945&num=20&t=否"></script>

The number after 'typeid' indicate the news' catalog (see table below)
264 文化傳真頁面
1055 教育新聞頁面
420 股市動態網頁面
567 財經要聞
205 影視焦點頁面
764 醫藥快訊頁面
777 兩性話題頁面
25 軍事評論頁面
64 軍事要聞頁面
167535 撞機頁面
945 中國新聞頁面
1007 社會新聞頁面
1000 國際新聞頁面
1024 要聞提示頁面
1040 國內足球新聞頁面
1221 NBA新聞頁面
1066 世界網球新聞頁面
1047 國際足球新聞頁面
154 科技新聞頁面
156 互連網絡新聞頁面
896 通訊聚焦新聞頁面
You should also check page http://app0.china.com/freecode/freenews.php to see the

latest infomation.

You also change the number of news you want to show, locates at line 41 and 57
At line 41, the number after 'num', and at line 57 is the value of variable

NewsItem. Change them to a same number which should be 10, 20, 30 ... 100.

樣本三: 天氣線上

代碼:--------------------------------------------------------------------------------HTML QuickLaunch ///

Weather by Lee1892
Infomations are from http://www.t7online.com/

java script:window.location.replace("file:///x:/.../Weather/index.html")

You should check you local city ID from http://www.t7online.com/ first, and then change line 98
original:
var MyCityURL="http://www.t7online.com/cgi-bin/citybild?PROVIDER=anwendung&WMO=58362&LANG=cn"
Change number after 'WMO=' to your local city ID.

樣本四: Winamp控制

代碼:--------------------------------------------------------------------------------HTML QuickLaunch ///

RunBox by [kmr]

java script:window.location.replace("file:///x:/...//HTMLql/AmpBar/index.html")

A winamp control. You need the WinampCOM plugin (http://www.adcock8.freeserve.co.uk) for the page to work properly.
Double-click the window to activate/desactivate the auto song info update.--------------------------------------------------------------------------------

這個呢就不是我自己做的樂,他給出的WinampCOM首頁也換到http://mysite.freeserve.com/johnadcock了,不過應該是不支援3.0的,呵呵
樣本五: RunBox,即在欄內鍵入命令即可運行,等同於Run對話方塊的功能

代碼:--------------------------------------------------------------------------------<html>
<head>
<title>Run Box</title>
<style>
body { border-width: 0; background-color: buttonface; color: black; font-family: verdana; font-size: 9px; margin: 3,0,0,0 }
</style>
<script language="JavaScript">
function Open(appName) {
//var appName="explorer /root,,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}";
var WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run(appName,1);
window.blur();
}
</script>
</head>
<body scroll="no">
<form onsubmit="Open(document.all.T1.value)">
<p><input type="text" name="T1" size="10" height="5"></p>
</form>
</body>
</html>--------------------------------------------------------------------------------

其實,windows內建的Address那個Toolbar就可以,之所以給出此例是想說明如何用HTML啟動程式,呵呵

最後的幾句話:

我想說的是我做的幾個樣本都還是很不成熟的,只是給大家一些想法。

我們知道HTML加上VBS和JS是十分強大的(比如對於Windows Messenger,有MAPI,不知道VBS能調用不?),還有花哨的Flash,您甚至可以把flash放到自己做的Sidebar裡(比如一個好玩的小遊戲,這樣就成了一個真正的案頭遊戲了)。

還有很多很多可以做的東西,您一定有更多的想法或更好的實現方法。請來參加討論吧,哪怕只是一些設想(或許有高手知道如何?呢)。

我只是一個拋磚的人

--------------------------------------------------------------------------------
以上內容由lnboy整理收藏,原帖在http://bbs.et8.net/bbs/

繼續閱讀《Windows工作列上顯示網頁的超酷玩法!!!!!!!!!!!》的全文內容...

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.