Tag Archives: Postaday2011

Drupal – Disable the Collapsible in Ubercart Checkout Panes

By default, the panes in the checkout form are collapsible. if you want to remove the collapsible features, you could customize the theme_uc_cart_checkout_form($form) function in your theme template.php. Continue reading Drupal – Disable the Collapsible in Ubercart Checkout Panes

jQuery & Javascript – Capture the Browser or Tab Closed Event

I was working on a WordPress project which i need to clear the PHP session when the browser or browser tab is closed. Although Javascript provides the window.onbeforeunload event but it will be triggered even whenever you leave the website. Finally i got a simple solution from Daniel Melo in StackOverflow. The following code required jQuery and i have included the Google one in the HTML.

In your web root, create the js/check_browser_close.js. Continue reading jQuery & Javascript – Capture the Browser or Tab Closed Event

陳文敏 – 小狗下井

最近在女兒的中文課外閱讀補充練習中看到這樣一個故事:小狗一天經過一口井,好奇地在井口往下望,但一不小心竟掉進井底,幸而井底的水很淺,才不致遇溺,但當時四下無人,小狗心想雖然不致溺斃,但這裡沒有食物,早晚可能會餓死。正在躊躇之際,小鹿正經過井口,看到小狗在井底,便問他在做甚麼,小狗念頭一轉,說井底的水很清澈,小鹿也下來喝一口吧。小鹿於是便撲通一下的跳進井中,井水果然清澈怡人,喝過井水後,小鹿便問小狗「噢!現在我們怎樣返回地面?」小狗說:「你用前腿趴在牆上,讓我抓著你的角跳上井口,然後我再拉你上去。」小鹿於是站起來,趴前腿在牆上,小狗一而躍上,從小鹿背上抓著小鹿的角便跳出井口,小鹿跟著向小狗說: 「你現在拉我上去吧!」小狗笑說:「我這麼細小,怎夠力氣拉你上來,你跳下來時實在太魯莽,沒經三思,現在我也沒辦法了。」跟著小狗便哼著歌兒離去,留下小鹿在井底。

故事末段問小朋友認為這個故事的教訓是甚麼?不知讀者會怎樣想?但答案竟然是做事不要魯莽,凡事該三思而行。故事中小鹿受人欺騙致身陷井底,小狗為求自保,先騙小鹿下井,再騙小鹿讓他跳出井口,跟著騙小鹿會拉小鹿出井口。 Continue reading 陳文敏 – 小狗下井

Math King – My Third Approved iPhone App

This slideshow requires JavaScript.

This is the last iPhone application i wrote when i was working in HKU and it is the most complicated one among the 3 apps since it needs to handle different types of questions like drag n drop and multiple choice… etc

There is a lite version which is free of charge, try it now. But it only has Chinese version. =P Continue reading Math King – My Third Approved iPhone App