從 Mootools 1.1 轉換到 1.2 的改變
2009/08/20
這篇文章詳細說明了各函式在兩個版本中的差異,可以看見1.2版更加結構化。
External Resources:
Browser
- 1.11
-
window.ie6
-
- 1.2
-
Browser.Engine.trident4
-
Element
- 1.11
-
el.getTag()
-
el.setHTML(string|array)
-
el.getText()
-
el.setText(string)
-
el.setOpacity(number)
-
el.remove()
-
el.replaceWith(element)
-
el.effects(obj)
-
$E(selector)
-
$ES(selector)
-
el.getSize().size.x/ el.getSize().size.y
-
- 1.2
-
el.get('tag')
-
el.set('html', string|array)
-
el.get('text')
-
el.set('text', string)
-
el.set('opacity', number)
-
el.dispose()
-
element.replaces(el) // note: inverts positions of element and el
-
new Fx.Morph(el, obj)
-
document.getElement(selector)
-
document.getElements(selector)
-
el.getSize().x/ el.getSize().y
-
Array
- 1.11
-
[].copy(start, length)
-
[].remove(item)
-
[].merge([])
-
[].test([])
-
- 1.2
- removed in favour of
$A
and[].slice
-
[].erase(item)
-
[].combine([])
-
[].contains([])
- removed in favour of
Function
- 1.11
-
fn.bindAsEventListener(object, array)
-
Function.empty
/Class.empty
-
- 1.2
- removed, since every
addEvent
callback has an event -
$empty
- removed, since every
Class
Missing …
Ajax
- 1.11
-
$('myform').send([options]);
-
new XHR({[options]}).send(url[, datastring]);
-
- 1.2
-
$('myform').set('send',[options]).send();
-
new Request({'url':url[, options]}).send([datastring]);
-
Cookie
- 1.11
-
Cookie.set(key, value[, options]);
-
Cookie.get(key)
-
Cookie.remove(cookie[, options]);
-
- 1.2
-
Cookie.write(key, value[, options]);
-
Cookie.read(key)
-
Cookie.dispose(cookie[, options]);
-
Json
- 1.11
-
Json.evaluate(string)
-
Json.toString(mixed)
-
- 1.2
-
JSON.decode(string, secure)
-
JSON.encode(mixed)
-
Extending
- 1.11
-
Element.extend(object)
,String.extend(object)
-
window.extend(object)
/document.extend(object)
-
- 1.2
-
String.implement(object)
/String.implement(string, function)
-
Window.implement(object)
/Document.implement(string, function)
-
Effects
- 1.11
-
FX.Style
-
new Fx.Style(element, property [, options]).start([from,] to);
-
$(element).effect(property [, options]).start([startvalue,] endvalue);
-
-
- 1.2
-
FX.Tween
-
new Fx.Tween(element [, options]).start([property], from[, to]);
-
$(element).get(property [, options]).start(startvalue[, endvalue]);
-
-
Plugins
Drag
- 1.11
-
new Drag.Base(el[, options]);
-
- 1.2
-
new Drag(el[, options]);
-