我正在阅读“
JavaScript the Good Parts”,它提到级联作为一种在JavaScript中进行方法链接的方法,但我找不到任何解释如何实现这些方法的代码.
getElement('myBoxDiv'). move(350,150). width(100). height(100). color('red'). border('10px outset'). padding('4px'). appendText("Please stand by"). on('mousedown',function (m) { this.startDrag(m,this.getNinth(m)); }). on('mousemove','drag'). on('mouseup','stopDrag'). later(2000,function ( ) { this. color('yellow'). setHTML("What hath God wraught?"). slide(400,40,200,200); }). tip('This Box is resizeable');