Dock

Dock & Dock with Iframe

很早就寫過把MacOS X形式的Dock放到網頁上的Javascript程式了;那時候的習慣不是很好、程式碼寫的有點糟;但是那時候還真有耐心啊(廢話那時候用掉的是一生只有一次的大學聯考激發出來的生產力啊,啊哈哈)。

這幾年過去有點小小的長進所以拿以前的程式做練習,意外發現同樣的行為用簡單的疊加程式碼就可以寫出來;根本不用先弄個時間-大小函數。終於有點長進了。

現在拿出來給大家申請使用。需要放在自己站上請舉手,要經過老師同意才能加入會員喔。我已經同意讓Aray用在她的COLOR BLOG上了;如果有想出圖示的話(想不出來啊)可能也會用在松江水綠 Web版上。

Iframe版本在IE上已知問題

如果Iframe內的網頁是一個標準網頁(也就是用<!DOCTYPE>開頭),IE會算錯它的寬度,然後顯示不知道在捲什麼的橫向捲軸。您用Dock-iframe逛MozTW就會感受到這個問題。解決方法是將網頁升級成xHTML 1.0標準。檔案用<?XML>開頭後面的<!DOCTYPE>就會被IE忽略。用兩個bug互相抵消的手段對付IE(唉);希望IE7出來的時候不會只修好一個,那就要想其他方法了。

This is one of my recent Javascript work. I chose Dock because I had done it before in a nasty way when I was a kid (laugh). Surprisingly Dock can be done in such simple code.

Please use these code with my prior permission.

Known Issue

When using Dock-iframe in IE, IE will display horizontal scroll bar if the webpage inside is a standard one, i.e. has <!DOCTYPE> tag. IE can never count width correctly. To avoid this simply upgrade your webpages to xHTML 1.0 standard; <!DOCTYPE> somehow would be omitted by IE since the webpage then begin with <?XML>. This is how we deal with IE: use two bugs to cancel each other. I hope this will work on IE7, too; haven’t tested it though.

4 thoughts on “Dock

  1. 改用 <object type=”text/html” data=”…”> 來寫吧 @@
    這是我在網路上神到的答案 (飄)

    看一下松韻網站的最新消息,就可以知道顯示的效果了 :p

  2. 松韻網站上的WebCalender生出來的code是xHTML 1.0 Transitional;前面有?XML tag會繞掉IE的bug。
    然後object tag無法移植到Dock-iframe上面… 原因,啊,跟你再MSN上說過了不想在這裡又打一遍(倒)。

  3. Pingback: CornGuo's BLOG

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.