官术网_书友最值得收藏!

Time for action—exploring the MooTools Core Builder

To explore the MooTools Core Builder, perform the following steps:

  1. Go to the MooTools Core Builder webpage by navigating to: http://mootools.net/core.
  2. Notice that the MooTools Core is subdivided into 7 sections. Each section has 2 to 6 JavaScript libraries associated with it. Take the time to read each description to help you get a better understanding of what each file does.
    Time for action—exploring the MooTools Core Builder
  3. Click on the Event component. Notice that several other components were automatically selected for you. This ensures that you also include the dependency files that are required for the Event component to run.
    Time for action—exploring the MooTools Core Builder
  4. Notice the different compression types. YUI Compressor is selected by default.
Time for action—exploring the MooTools Core Builder

What just happened?

We just covered how to roll your own MooTools Core file and learned about the MooTools Core structure by exploring the MooTools Core builder. Once you're comfortable with how MooTools works, you should use the MooTools Core Builder to create a MooTools Core file that includes only the components you need.

Have a go hero — — explore the MooTools Core Builder output

Try to download the previous example with the Events component checked. After downloading your own version of the MooTools Core, open the file in your favorite text editor. Also open the MooTools Core file that you downloaded earlier. Notice that the one you just downloaded is significantly shorter; that's because you only downloaded the Events component and its dependency files.

Have a go hero — — explore the MooTools Core Builder output

The entire uncompressed MooTools Core is close to 4,000 lines long (and has a file size of 96 KB).

Have a go hero — — explore the MooTools Core Builder output

In comparison, the Core Builder output where only Events and its dependencies are included is just a little over 1,000 lines of code (and weighing only 24 KB).

MooTools More

The second part of the MooTools framework is simply called More. As the name implies, it is a collection of useful plugins, functions, classes, and methods that extends the MooTools Core.

主站蜘蛛池模板: 吕梁市| 贵定县| 新民市| 伊宁市| 西宁市| 福泉市| 大英县| 房山区| 茌平县| 壶关县| 邹平县| 金堂县| 志丹县| 加查县| 客服| 苍山县| 济宁市| 迁西县| 涟水县| 将乐县| 乌兰察布市| 罗江县| 都昌县| 喀喇| 化隆| 黄山市| 内丘县| 庆城县| 诏安县| 凉城县| 聂拉木县| 衡东县| 朝阳区| 高安市| 高阳县| 扶余县| 资源县| 仙游县| 饶河县| 包头市| 皮山县|