Menu

從 Mootools 1.1 轉換到 1.2 的改變

這篇文章詳細說明了各函式在兩個版本中的差異,可以看見1.2版更加結構化。

 

External Resources:

Browser

  • 1.11
    1. window.ie6
  • 1.2
    1. Browser.Engine.trident4

Element

  • 1.11
    1. el.getTag()
    2. el.setHTML(string|array)
    3. el.getText()
    4. el.setText(string)
    5. el.setOpacity(number)
    6. el.remove()
    7. el.replaceWith(element)
    8. el.effects(obj)
    9. $E(selector)
    10. $ES(selector)
    11. el.getSize().size.x/ el.getSize().size.y
  • 1.2
    1. el.get('tag')
    2. el.set('html', string|array)
    3. el.get('text')
    4. el.set('text', string)
    5. el.set('opacity', number)
    6. el.dispose()
    7. element.replaces(el) // note: inverts positions of element and el
    8. new Fx.Morph(el, obj)
    9. document.getElement(selector)
    10. document.getElements(selector)
    11. el.getSize().x/ el.getSize().y

Array

  • 1.11
    1. [].copy(start, length)
    2. [].remove(item)
    3. [].merge([])
    4. [].test([])
  • 1.2
    1. removed in favour of $A and [].slice
    2. [].erase(item)
    3. [].combine([])
    4. [].contains([])

Function

  • 1.11
    1. fn.bindAsEventListener(object, array)
    2. Function.empty/Class.empty
  • 1.2
    1. removed, since every addEvent callback has an event
    2. $empty

Class

Missing …

Ajax

  • 1.11
    1. $('myform').send([options]);
    2. new XHR({[options]}).send(url[, datastring]);
  • 1.2
    1. $('myform').set('send',[options]).send();
    2. new Request({'url':url[, options]}).send([datastring]);

Cookie

  • 1.11
    1. Cookie.set(key, value[, options]);
    2. Cookie.get(key)
    3. Cookie.remove(cookie[, options]);
  • 1.2
    1. Cookie.write(key, value[, options]);
    2. Cookie.read(key)
    3. Cookie.dispose(cookie[, options]);

Json

  • 1.11
    1. Json.evaluate(string)
    2. Json.toString(mixed)
  • 1.2
    1. JSON.decode(string, secure)
    2. JSON.encode(mixed)

Extending

  • 1.11
    1. Element.extend(object), String.extend(object)
    2. window.extend(object)/document.extend(object)
  • 1.2
    1. String.implement(object)/String.implement(string, function)
    2. Window.implement(object)/Document.implement(string, function)

Effects

  • 1.11
    • FX.Style
      1. new Fx.Style(element, property [, options]).start([from,] to);
      2. $(element).effect(property [, options]).start([startvalue,] endvalue);
  • 1.2
    • FX.Tween
      1. new Fx.Tween(element [, options]).start([property], from[, to]);
      2. $(element).get(property [, options]).start(startvalue[, endvalue]);

Plugins

Drag

  • 1.11
    1. new Drag.Base(el[, options]);
  • 1.2
    1. new Drag(el[, options]);