[Type] JQuery

Part of: mobl
Inherits from: mobl::Dynamic

Mobl wrapped version of the jQuery API. There are two ways to obtain a JQuery object. Either by using the $ function, or by using the name@<html/> notation, which assigns a JQuery object representing the HTML tag to name.

Example:

$("body").css("background-color", "black");

Example 2:

control slideUp() {
  d@<div onclick={
      d.slideUp();
    }>
    elements()
  </div>
}
screen root() {
  slideUp {
    "Click me to have me slide up"
  }
}

Instance methods

All these map immediately to their jQuery equivalents.

fadeIn(fn : Callback = null) : JQuery

fadeOut(fn : Callback = null) : JQuery

slideUp(fn : Callback = null) : JQuery

slideDown(fn : Callback = null) : JQuery

slideToggle(fn : Callback = null) : JQuery

eq(idx : Num) : JQuery

find(selector : String) : JQuery

parent() : JQuery

parents(selector : String) : JQuery

hide() : JQuery

show() : JQuery

toggle() : JQuery

detach() : JQuery

addClass(cssClass : String) : JQuery

hasClass(cssClass : String) : Bool

css(name : String, val : String) : JQuery

html() : String

val() : String

is(what : String) : Bool

bind(eventName : String, fn : Callback) : JQuery

unbind(eventName : String, fn : Callback) : JQuery

replaceWith(coll : JQuery) : JQuery

append(coll : JQuery) : JQuery

prepend(coll : JQuery) : JQuery

remove() : JQuery

position() : JQueryPosition

Returns the JQueryPosition.

innerWidth() : Num

innerHeight() : Num

outerWidth() : Num

outerHeight() : Num

scrollTop() : Num

Instance properties

length : Num

mobl/jquery.txt · Last modified: 2013/10/01 02:28 (external edit)