fx.openHelp.custom(0, this.SIDEBAR_WIDTH ??“ this.SIDEBAR_MARGIN);
Help.fx.slideBody.custom(this.SIDEBAR_MARGIN , this.SIDEBAR_WIDTH);
},
close : function() {
Help.fx.closeHelp.custom(this.SIDEBAR_WIDTH ??“ this.SIDEBAR_MARGIN , 0);
Help.fx.slideBody.custom(this.SIDEBAR_WIDTH , this.SIDEBAR_MARGIN );
},
CHAPTER 9 n A DYNAMIC HELP SYSTEM 203
request : function(url, callback) {
new Ajax.Updater('help', url, {
method: 'get',
onComplete: callback.bind(this)
});
}
};
Now open and close: use the custom method of the effects objects to perform the animations
passing in the start and end values for the animation.
Implementing Anchors Within the Sidebar
You might have noticed that when using the basic HTML-only version of the help system,
clicking the help for Sprocket ID will take you directly to that section of the sprocket help
page. This is because you??™ve used a normal HTML page anchor to ensure that the browser
scrolls to the relevant section:
?But after you implemented the enhanced version, which hijacks the browser??™s normal
behavior, you lost this effect. However, it would be great to enhance the script so that users
would be taken straight to the relevant part of the help in the sidebar. Maybe you could
even improve on this by implementing some kind of highlighting of that section to draw
the user??™s eye.
A great approach to solving many DOM scripting problems is to try to use the information
contained within the HTML as much as possible.
Pages:
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285