13. March 2016

ReactJS - Template Method Pattern

The Template Method Pattern let you redefine certain steps of an algorithm without changing the algorithm’s structure. It is important for the UI design

preview

more

23. February 2016

postaljs - 前端组件化框架的救星

Postaljs是一款js pub/sub 库,相当于为页面应用提供了一个新的事件/消息系统。 作为原始JS开发,貌似对这种事件系统需求不大,然而要使用组件化开发,无论是reactjs还是angular,这种事件系统都会起到很大的作用。

preview

more

02. February 2016

Re-Make of Dido Timer

This is the dido-timer, which is first published as mobile app in cordova in the end of 2014. And now it can be run on browsers with mobile shell.

preview

16. January 2016

The animate.table alpha preview

animate.table is a jquery plugin(would be react component and npm package in future) which can initialize a html table by json data with animations. animate.table is also a dynamic table. you can also insert\remove\update table or rows with animation.

preview

more

11. January 2016

The device shell for device preview

DeviceShell is a jquery plugin to provide device shell for any div in a laptop html pages. If your visit the page on mobile or pad, the content is auto set as full screened.

preview

more

15. December 2015

My handy codes

Quick code reference

Front code collections for quickly input

preview

Callback when animation ends

var ANI_EVENT_NAME = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
$(ele).on(ANI_EVENT_NAME,
    function(){
        $(this).off(ANI_EVENT_NAME);
    }
);

10. October 2013

JavaScript Apply, Call, and Bind

We will discuss every scenario in which we use these three methods in JavaScript. While Apply and Call come with ECMAScript 3 (available on IE 6, 7, 8, and modern browsers), ECMAScript 5 (available on only modern browsers) added the Bind method. These 3 Function methods are workhorses and sometimes you absolutely need one of them. Let’s begin with the Bind method.

preview

more