国产宅男网站在线|亚洲A级性爱免费视频|亚洲中精品级在线|午夜福利AA毛

  • <dd id="gf5jf"><th id="gf5jf"></th></dd>

    <cite id="gf5jf"><label id="gf5jf"></label></cite>
  • <div id="gf5jf"><listing id="gf5jf"></listing></div>
    學習啦 > 知識大全 > 知識百科 > 百科知識 > mootools如何面向對象

    mootools如何面向對象

    時間: 謝君787 分享

    mootools如何面向對象

      MooTools是一個簡潔,模塊化,面向對象的開源JavaScript web應用框架,下面就讓學習啦小編來給你科普一下什么是mootools。

      mootools的簡介

      它為web開發(fā)者提供了一個跨瀏覽器js解決方案。在處理js、css、html時候。

      它提供了一個比普通js更面向對象的documentAPI。

      mootools的優(yōu)點

      1.靈活,模塊化的框架,用戶可以選擇自己需要的組件。

      2.MooTools符合OO的思想,使代碼更強壯,有力,有效。

      3.高效的組件機制,可以和flash進行完美的交互。

      4.對于DOM的擴展增強,使開發(fā)者更好的利用document

      mootools的組件

      MooTools包含很多組件,官方網站MooTools支持你下提取自己需要的獨立代碼而不需要全部下載, 同時可以選擇壓縮的級別。

      Core:常用函數(shù)集合,其它組件必須的

      Class:MooTools類的實例化的基礎庫

      Natives:原始類的擴展。

      Element:包含一些對html element及其擴展

      Fx:一個動態(tài)元素高級效果的API

      Requests:為開發(fā)者提供xhttpRequest cookie json html特定檢索工具

      Window:提供一個獲取client信息的跨瀏覽器接口

      mootools的兼容性

      Safari 2+

      Internet Explorer 6+

      Mozilla Firefox 2+

      Opera 9+

      Camino 1.5+

      mootools面向對象

      MooTools包含一個健壯的類創(chuàng)建器和繼承系統(tǒng)類似其它OO的語言

      例如:以下代碼提供和鏈接中(http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming#Examples)地址類似的功能

      var Animal = new Class({

      initialize: function(name){

      this.name = name;

      }

      });

      var Cat = new Class({

      Extends: Animal,

      talk: function(){

      return 'Meow!';

      }

      });

      var Dog = new Class({

      Extends: Animal,

      talk: function(){

      return 'Arf! Arf';

      }

      });

      var Animals = {

      a: new Cat('Missy'),

      b: new Cat('Mr. Bojangles'),

      c: new Dog('Lassie')

      };

      for(var animal in Animals) alert(animal.name + ': ' + animal.talk());

      // alerts the following:

      //

      // Missy: Meow!

      // Mr. Bojangles: Meow!

      // Lassie: Arf! Arf!
    看過“mootools如何面向對象”的人還看了:
    1.Javascript學習計劃范文

    2157326