Trait

org.querki.jquery

JQuery

Related Doc: package jquery

Permalink

trait JQuery extends Object

A facade for the main jQuery object.

This is a reimplementation, very loosely based on the existing scalajs-jquery. It aims to be much more strongly and precisely typed, while being as literal a translation of the functionality of jQuery as possible. It is intentionally pretty close to scalajs-jquery, and many files can be switched over by simply switching the import, but compatibility has *not* been a priority, and a modest number of functions have changed in breaking ways. (This is one reason why I treated this as a rewrite rather than as an evolution of the existing library.)

TODO: as of this writing, this is *quite* incomplete; I am only adding functions as I use them, and at least half of them are currently missing. Pull requests are greatly welcomed. In particular, we are lacking many overloads -- I've added some of them, but many jQuery functions have a considerable number of potential overloads.

Many parameters are polymorphic. We often use | (type union) to define these, but | and UndefOr don't mix, so we often have to spell things out in more detail. Also, you can't use a js.Function or js.ThisFunction in a | expression, because it interferes with the compiler's implicit conversion from a Scala function to a js.Function. Note that there are several common unions such as Selector defined in package.scala.

Things are also often spelled out more explicitly than you might expect, because Scala restricts us to one overload per method with default parameters; this limits our usage of UndefOr.

We don't necessarily spell out every possible overload here, although we've made a serious effort to make every version of the JS calls possible. In some cases, we only have versions that involve some extra parameters. If you find yourself really wanting an overload that takes fewer parameters, pull requests are welcome.

NOTE: discussion on scalajs Gitter, 1/28/15, says that facades should *return* Any, but *take* js.Any *if* the Javascript is going to process the value in any way. This is the guiding principle here.

Also: when a facade function takes a property bag, if it is understood to be name/value pairs in JS, declare it as js.Dictionary[T]. Often, we can constrain T; if not, just put js.Any, and it is at least explicit that it is name/value pairs.

Long-deprecated functions are, by and large, simply omitted. Please see the jQuery documentation to see what to use instead.

Annotations
@RawJSType() @native()
Linear Supertypes
Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. JQuery
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def not(func: ThisFunction2[Element, Integer, Element, Boolean]): Unit

    Permalink
  2. abstract def not(selector: ElementDesc): Unit

    Permalink

    Remove elements from the set of matched elements.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def add(selector: String, context: Element): JQuery

    Permalink
  5. def add(selector: ElementDesc): JQuery

    Permalink

    Create a new jQuery object with elements added to the set of matched elements.

  6. def addBack(selector: String = ???): JQuery

    Permalink

    Add the previous set of elements on the stack to the current set, optionally filtered by a selector.

  7. def addClass(func: ThisFunction2[Element, Int, String, String]): JQuery

    Permalink
  8. def addClass(classNames: String): JQuery

    Permalink

    Adds the specified class(es) to each of the set of matched elements.

  9. def after(func: ThisFunction1[Element, Int, ElementDesc]): JQuery

    Permalink
  10. def after(func: ThisFunction0[Element, ElementDesc]): JQuery

    Permalink
  11. def after(content: ElementDesc*): JQuery

    Permalink

    Insert content, specified by the parameter, after each element in the set of matched elements.

  12. def ajaxComplete(handler: Function3[JQueryEventObject, JQueryXHR, JQueryAjaxSettings, Any]): JQuery

    Permalink

    Register a handler to be called when Ajax requests complete.

  13. def ajaxError(handler: Function4[JQueryEventObject, JQueryXHR, JQueryAjaxSettings, String, Any]): JQuery

    Permalink

    Register a handler to be called when Ajax requests complete with an error.

  14. def ajaxSend(handler: Function3[JQueryEventObject, JQueryXHR, JQueryAjaxSettings, Any]): JQuery

    Permalink

    Attach a function to be executed before an Ajax request is sent.

  15. def ajaxStart(handler: Function0[Any]): JQuery

    Permalink

    Register a handler to be called when the first Ajax request begins.

  16. def ajaxStop(handler: Function0[Any]): JQuery

    Permalink

    Register a handler to be called when all Ajax requests have completed.

  17. def ajaxSuccess(handler: Function4[JQueryEventObject, JQueryXHR, JQueryAjaxSettings, Object, Any]): JQuery

    Permalink

    Attach a function to be executed whenever an Ajax request completes successfully.

  18. def animate(properties: Dictionary[Any], options: JQueryAnimationSettings): JQuery

    Permalink
  19. def animate(properties: Dictionary[Any], duration: |[Number, String], easing: String = ???, complete: ThisFunction0[Element, Any] = ???): JQuery

    Permalink

    Perform a custom animation of a set of CSS properties.

  20. def append(func: ThisFunction2[Element, Int, String, Any]): JQuery

    Permalink
  21. def append(content: ElementDesc*): JQuery

    Permalink

    Insert content, specified by the parameter, to the end of each element in the set of matched elements.

  22. def appendTo(target: ElementDesc): JQuery

    Permalink

    Insert every element in the set of matched elements to the end of the target.

  23. def apply(x: Int): Element

    Permalink

    Shorthand for get(x), lifted from scalajs-jquery

    Shorthand for get(x), lifted from scalajs-jquery

    Annotations
    @JSBracketAccess()
  24. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  25. def attr(attributeName: String, func: ThisFunction2[Element, Int, String, AttrVal]): JQuery

    Permalink
  26. def attr(attributeName: String, v: AttrVal): JQuery

    Permalink

    Set an attribute for the set of matched elements.

  27. def attr(attributes: Dictionary[String]): JQuery

    Permalink
  28. def attr(attributeName: String): UndefOr[String]

    Permalink

    Get the value of an attribute for the first element in the set of matched elements.

    Get the value of an attribute for the first element in the set of matched elements.

    Note that this returns UndefOr -- it is entirely legal for this to return undefined if the attribute is not present, and that causes things to crash if it is not UndefOr.

  29. def before(func: ThisFunction2[Element, Integer, String, |[|[String, Element], JQuery]]): JQuery

    Permalink
  30. def before(content: ElementDesc, addlContent: ElementDesc*): JQuery

    Permalink

    Insert content, specified by the parameter, before each element in the set of matched elements.

  31. def bind(events: Dictionary[ThisFunction1[Element, JQueryEventObject, Any]]): JQuery

    Permalink
  32. def bind(eventType: String, preventBubble: Boolean): JQuery

    Permalink
  33. def bind(eventType: String, eventData: Any, handler: ThisFunction1[Element, JQueryEventObject, Any]): JQuery

    Permalink
  34. def bind(eventType: String, handler: ThisFunction1[Element, JQueryEventObject, Any]): JQuery

    Permalink

    Attach a handler to an event for the elements.

  35. def blur(eventData: Any, handler: EventHandler): JQuery

    Permalink
  36. def blur(handler: EventHandler): JQuery

    Permalink
  37. def blur(): JQuery

    Permalink

    Bind an event handler to the "blur" JavaScript event, or trigger that event on an element.

  38. def change(eventData: Any, handler: EventHandler): JQuery

    Permalink
  39. def change(handler: EventHandler): JQuery

    Permalink
  40. def change(): JQuery

    Permalink

    Bind an event handler to the "change" JavaScript event, or trigger that event on an element.

    Bind an event handler to the "change" JavaScript event, or trigger that event on an element.

    NOTE: the jQuery documentation is very fuzzy on this point, but implies in an example that "this" gets set appropriately.

  41. def children(selector: String = ???): JQuery

    Permalink

    Get the children of each element in the set of matched elements, optionally filtered by a selector.

  42. def clearQueue(queueName: String = ???): JQuery

    Permalink

    Remove from the queue all items that have not yet been run.

  43. def click(handler: EventHandler): JQuery

    Permalink
  44. def click(): JQuery

    Permalink

    Bind an event handler to the "click" JavaScript event, or trigger that event on an element.

    Bind an event handler to the "click" JavaScript event, or trigger that event on an element.

    This is the simpler version, and usually what you want.

  45. def clone(withDataAndEvents: Boolean, deepWithDataAndEvents: Boolean): JQuery

    Permalink
  46. def clone(withDataAndEvents: Boolean): JQuery

    Permalink
  47. def clone(): JQuery

    Permalink

    Create a deep copy of the set of matched elements.

    Create a deep copy of the set of matched elements.

    Note that this requires an override because Scala.Object declares a clone() method which is entirely unrelated.

    Definition Classes
    JQuery → AnyRef
  48. def closest(selector: String, context: Element): JQuery

    Permalink
  49. def closest(selector: |[|[String, Element], JQuery]): JQuery

    Permalink

    For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.

  50. def contents(): JQuery

    Permalink

    Get the children of each element in the set of matched elements, including text and comment nodes.

  51. def css(properties: Dictionary[Any]): JQuery

    Permalink
  52. def css(propertyName: String, value: |[String, Int]): JQuery

    Permalink
  53. def css(propertyNames: Array[String]): Dictionary[String]

    Permalink
  54. def css(propertyName: String): String

    Permalink

    Get the computed style properties for the first element in the set of matched elements.

  55. def data(): Dictionary[Any]

    Permalink

    Calling .data() with no parameters retrieves all of the values as a JavaScript object.

    Calling .data() with no parameters retrieves all of the values as a JavaScript object. This object can be safely cached in a variable as long as a new object is not set with .data(obj). Using the object directly to get or set values is faster than making individual calls to .data() to get or set each value.

  56. def data(key: String): UndefOr[Any]

    Permalink

    Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute.

    Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. Undefined if that key is not set.

  57. def data(obj: Dictionary[Any]): JQuery

    Permalink
  58. def data(key: String, value: Any): JQuery

    Permalink

    Store arbitrary data associated with the matched elements.

    Store arbitrary data associated with the matched elements.

    undefined is not recognised as a data value. Calls such as .data( "name", undefined ) will return the corresponding data for "name", and is therefore the same as .data( "name" ).

  59. def dblclick(eventData: Any, handler: EventHandler): JQuery

    Permalink
  60. def dblclick(handler: EventHandler): JQuery

    Permalink
  61. def dblclick(): JQuery

    Permalink

    Bind an event handler to the "dblclick" JavaScript event.

  62. def delay(duration: Int, queueName: String = ???): JQuery

    Permalink

    Set a timer to delay execution of subsequent items in the queue.

  63. def dequeue(queueName: String = ???): JQuery

    Permalink

    Execute the next function on the queue for the matched elements.

  64. def detach(selector: String): JQuery

    Permalink
  65. def detach(): JQuery

    Permalink

    Remove the set of matched elements from the DOM.

  66. def each(func: ThisFunction1[Element, Int, Any]): JQuery

    Permalink
  67. def each(func: ThisFunction0[Element, Any]): JQuery

    Permalink

    Iterate over a jQuery object, executing a function for each matched element.

    Iterate over a jQuery object, executing a function for each matched element.

    Note that we do not bother with the full jQuery signature, since the "element" parameter simply matches "this".

    You can stop the loop from within the callback function by returning false. Otherwise, the return value is irrelevant.

  68. def empty(): JQuery

    Permalink

    Remove all child nodes of the set of matched elements from the DOM.

  69. def end(): JQuery

    Permalink

    End the most recent filtering operation in the current chain and return the set of matched elements to its previous state.

  70. def eq(index: Integer): JQuery

    Permalink

    Reduce the set of matched elements to the one at the specified index.

  71. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  72. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  73. def fadeIn(options: JQueryAnimationSettings): JQuery

    Permalink
  74. def fadeIn(duration: |[Number, String], easing: String = ???, complete: ThisFunction0[Element, Any] = ???): JQuery

    Permalink
  75. def fadeIn(easing: String, complete: ThisFunction0[Element, Any]): JQuery

    Permalink
  76. def fadeIn(easing: String): JQuery

    Permalink
  77. def fadeIn(): JQuery

    Permalink

    Display the matched elements by fading them to opaque.

  78. def fadeOut(options: JQueryAnimationSettings): JQuery

    Permalink
  79. def fadeOut(duration: |[Number, String], easing: String = ???, complete: ThisFunction0[Element, Any] = ???): JQuery

    Permalink
  80. def fadeOut(easing: String, complete: ThisFunction0[Element, Any]): JQuery

    Permalink
  81. def fadeOut(easing: String): JQuery

    Permalink
  82. def fadeOut(): JQuery

    Permalink

    Hide the matched elements by fading them to transparent.

  83. def fadeTo(duration: |[String, Number], opacity: Number, easing: String = ???, complete: ThisFunction0[Element, Any] = ???): JQuery

    Permalink

    Adjust the opacity of the matched elements.

  84. def fadeToggle(options: JQueryAnimationSettings): JQuery

    Permalink
  85. def fadeToggle(duration: |[Number, String], easing: String = ???, complete: ThisFunction0[Element, Any] = ???): JQuery

    Permalink
  86. def fadeToggle(easing: String, complete: ThisFunction0[Element, Any]): JQuery

    Permalink
  87. def fadeToggle(easing: String): JQuery

    Permalink
  88. def fadeToggle(): JQuery

    Permalink

    Display or hide the matched elements by animating their opacity.

  89. def filter(func: ThisFunction1[Element, Int, Boolean]): JQuery

    Permalink
  90. def filter(func: ThisFunction0[Element, Boolean]): JQuery

    Permalink
  91. def filter(selector: Selector): JQuery

    Permalink

    Reduce the set of matched elements to those that match the selector or pass the function's test.

  92. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  93. def find(selector: Selector): JQuery

    Permalink

    Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.

  94. def finish(queue: String = "fx"): JQuery

    Permalink

    Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements.

  95. def first(): JQuery

    Permalink

    Reduce the set of matched elements to the first in the set.

  96. def focus(eventData: Any, handler: EventHandler): JQuery

    Permalink
  97. def focus(handler: EventHandler): JQuery

    Permalink
  98. def focus(): JQuery

    Permalink

    Bind an event handler to the "focus" JavaScript event, or trigger that event on an element.

  99. def focusin(eventData: Any, handler: EventHandler): JQuery

    Permalink
  100. def focusin(handler: EventHandler): JQuery

    Permalink
  101. def focusin(): JQuery

    Permalink

    Bind an event handler to the "focusin" event.

  102. def focusout(eventData: Any, handler: EventHandler): JQuery

    Permalink
  103. def focusout(handler: EventHandler): JQuery

    Permalink
  104. def focusout(): JQuery

    Permalink

    Bind an event handler to the "focusout" event.

  105. def get(): Array[_]

    Permalink

    Retrieve the elements matched by the jQuery object.

  106. def get(index: Int): UndefOr[Element]

    Permalink

    Retrieve one of the elements matched by the jQuery object.

    Retrieve one of the elements matched by the jQuery object.

    If the value of index is out of bounds - less than the negative number of elements or equal to or greater than the number of elements - it returns undefined.

  107. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  108. def has(selector: Selector): JQuery

    Permalink

    Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.

  109. def hasClass(className: String): Boolean

    Permalink

    Determine whether any of the matched elements are assigned the given class.

  110. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  111. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  112. def height(value: ThisFunction2[Element, Integer, Integer, |[Number, String]]): JQuery

    Permalink
  113. def height(value: |[Double, String]): JQuery

    Permalink

    Set the CSS height of every matched element.

  114. def height(): Double

    Permalink

    Get the current computed height for the first element in the set of matched elements.

  115. def hide(duration: |[String, Int], easing: String = ???, complete: Function = ???): JQuery

    Permalink
  116. def hide(duration: |[String, Int], complete: Function): JQuery

    Permalink
  117. def hide(): JQuery

    Permalink

    Hide the matched elements.

  118. def hover(handlerInOut: EventHandler): JQuery

    Permalink

    Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements.

  119. def hover(handlerIn: EventHandler, handlerOut: EventHandler): JQuery

    Permalink

    Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements.

  120. def html(func: ThisFunction2[Element, Int, String, String]): JQuery

    Permalink
  121. def html(t: String): JQuery

    Permalink

    Set the HTML contents of every matched element.

  122. def html(): String

    Permalink

    Get the HTML contents of the first element in the set of matched elements.

  123. def index(selector: ElementDesc): Int

    Permalink
  124. def index(): Int

    Permalink

    Search for a given element from among the matched elements.

  125. def innerHeight(): Double

    Permalink

    Get the current computed inner height (including padding but not border) for the first element in the set of matched elements.

  126. def innerWidth(): Double

    Permalink

    Get the current computed inner width (including padding but not border) for the first element in the set of matched elements.

  127. def insertAfter(target: ElementDesc): JQuery

    Permalink

    Insert every element in the set of matched elements after the target.

  128. def insertBefore(target: ElementDesc): JQuery

    Permalink

    Insert every element in the set of matched elements before the target.

  129. def is(func: ThisFunction1[Element, Int, Boolean]): Boolean

    Permalink

    Note that this overload doesn't precisely match the jQuery documentation; we elide the redundant Element param, since you have Element as the this parameter.

  130. def is(selector: Selector): Boolean

    Permalink

    Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.

  131. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  132. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  133. def jquery: String

    Permalink

    A string containing the jQuery version number.

  134. def keydown(): JQuery

    Permalink
  135. def keydown(eventData: Any, handler: EventHandler): JQuery

    Permalink
  136. def keydown(handler: EventHandler): JQuery

    Permalink

    Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element.

  137. def keypress(): JQuery

    Permalink
  138. def keypress(eventData: Any, handler: EventHandler): JQuery

    Permalink
  139. def keypress(handler: EventHandler): JQuery

    Permalink

    Bind an event handler to the "keypress" JavaScript event, or trigger that event on an element.

  140. def keyup(): JQuery

    Permalink
  141. def keyup(eventData: Any, handler: EventHandler): JQuery

    Permalink
  142. def keyup(handler: EventHandler): JQuery

    Permalink

    Bind an event handler to the "keyup" JavaScript event, or trigger that event on an element.

  143. def last(): JQuery

    Permalink

    Reduce the set of matched elements to the final one in the set.

  144. def length: Int

    Permalink

    The number of elements in the jQuery object.

  145. def load(url: String, data: |[String, Object], complete: ThisFunction3[Element, String, String, JQueryXHR, Any]): JQuery

    Permalink
  146. def load(url: String, data: |[String, Object]): JQuery

    Permalink
  147. def load(url: String): JQuery

    Permalink

    Load data from the server and place the returned HTML into the matched element.

  148. def map(func: ThisFunction1[Element, Int, Any]): JQuery

    Permalink
  149. def map(func: ThisFunction0[Element, Any]): JQuery

    Permalink

    Pass each element in the current matched set through a function, producing a new jQuery object containing the return values.

    Pass each element in the current matched set through a function, producing a new jQuery object containing the return values.

    For Scala code, it is often more convenient to use the mapElems() extension function.

    Within the callback function, this refers to the current DOM element for each iteration. The function can return an individual data item or an array of data items to be inserted into the resulting set.

    If a js.Array is returned, the elements inside the array are inserted into the set. If the function returns null or undefined, no element will be inserted. (Note the implication: this doesn't quite match the usual Scala semantics of map() -- there is a flatten component as well.)

  150. def mousedown(eventData: Any, handler: EventHandler): JQuery

    Permalink
  151. def mousedown(handler: EventHandler): JQuery

    Permalink
  152. def mousedown(): JQuery

    Permalink

    Bind an event handler to the "mousedown" JavaScript event, or trigger that event on an element.

  153. def mouseenter(eventData: Any, handler: EventHandler): JQuery

    Permalink
  154. def mouseenter(handler: EventHandler): JQuery

    Permalink
  155. def mouseenter(): JQuery

    Permalink

    Bind an event handler to the "mouseenter" JavaScript event, or trigger that event on an element.

  156. def mouseleave(eventData: Any, handler: EventHandler): JQuery

    Permalink
  157. def mouseleave(handler: EventHandler): JQuery

    Permalink
  158. def mouseleave(): JQuery

    Permalink

    Bind an event handler to the "mouseleave" JavaScript event, or trigger that event on an element.

  159. def mousemove(eventData: Any, handler: EventHandler): JQuery

    Permalink
  160. def mousemove(handler: EventHandler): JQuery

    Permalink
  161. def mousemove(): JQuery

    Permalink

    Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element.

  162. def mouseout(eventData: Any, handler: EventHandler): JQuery

    Permalink
  163. def mouseout(handler: EventHandler): JQuery

    Permalink
  164. def mouseout(): JQuery

    Permalink

    Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element.

  165. def mouseover(eventData: Any, handler: EventHandler): JQuery

    Permalink
  166. def mouseover(handler: EventHandler): JQuery

    Permalink
  167. def mouseover(): JQuery

    Permalink

    Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element.

  168. def mouseup(eventData: Any, handler: EventHandler): JQuery

    Permalink
  169. def mouseup(handler: EventHandler): JQuery

    Permalink
  170. def mouseup(): JQuery

    Permalink

    Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element.

  171. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  172. def next(selector: String = ???): JQuery

    Permalink

    Get the immediately following sibling of each element in the set of matched elements.

    Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector.

  173. def nextAll(selector: String = ???): JQuery

    Permalink

    Get all following siblings of each element in the set of matched elements, optionally filtered by a selector.

  174. def nextUntil(element: |[Element, JQuery], filter: String = ???): JQuery

    Permalink
  175. def nextUntil(selector: String, filter: String): JQuery

    Permalink
  176. def nextUntil(selector: String): JQuery

    Permalink
  177. def nextUntil(): JQuery

    Permalink

    Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.

  178. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  179. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  180. def off(): JQuery

    Permalink
  181. def off(event: JQueryEventObject): JQuery

    Permalink
  182. def off(eventsMap: Dictionary[EventHandler], selector: String = ???): JQuery

    Permalink
  183. def off(events: String, handler: EventHandler): JQuery

    Permalink
  184. def off(events: String, selector: String, handler: EventHandler): JQuery

    Permalink
  185. def off(events: String, selector: String): JQuery

    Permalink
  186. def off(events: String): JQuery

    Permalink

    Remove an event handler.

  187. def offset(func: Function2[Integer, JQueryPosition, JQueryPosition]): JQuery

    Permalink
  188. def offset(coordinates: JQueryPosition): JQuery

    Permalink
  189. def offset(): JQueryPosition

    Permalink

    Get the current coordinates of the first element in the set of matched elements, relative to the document.

  190. def offsetParent(): JQuery

    Permalink

    Get the closest ancestor element that is positioned.

  191. def on(eventsMap: Dictionary[EventHandler]): JQuery

    Permalink
  192. def on(eventsMap: Dictionary[EventHandler], selector: String): JQuery

    Permalink
  193. def on(eventsMap: Dictionary[EventHandler], selector: String, data: Any): JQuery

    Permalink
  194. def on(events: String): JQuery

    Permalink
  195. def on(events: String, turnOff: Boolean): JQuery

    Permalink
  196. def on(events: String, selector: String): JQuery

    Permalink
  197. def on(events: String, selector: String, data: Any): JQuery

    Permalink
  198. def on(events: String, selector: String, data: Any, turnOff: Boolean): JQuery

    Permalink

    Attach an event handler function for one or more events to the selected elements.

    Attach an event handler function for one or more events to the selected elements.

    This version of the signature allows you to pass in "false" as the handler. This is kind of magical in jQuery -- it is shorthand for a function that just does "return false", which stops propagation on the event. Note that true is *not* a legal value, only false.

  199. def on(events: String, handler: Function3[JQueryEventObject, Any, Any, Any]): JQuery

    Permalink
  200. def on(events: String, handler: Function2[JQueryEventObject, Any, Any]): JQuery

    Permalink
  201. def on(events: String, handler: ThisFunction3[Element, JQueryEventObject, Any, Any, Any]): JQuery

    Permalink
  202. def on(events: String, handler: ThisFunction2[Element, JQueryEventObject, Any, Any]): JQuery

    Permalink
  203. def on(events: String, handler: EventHandler): JQuery

    Permalink
  204. def on(events: String, selector: String, data: Any, handler: EventHandler): JQuery

    Permalink

    Attach an event handler function for one or more events to the selected elements.

    Attach an event handler function for one or more events to the selected elements.

    Note that this contains overloads for up to 2 "extra" parameters to the handler, but the number is potentially unlimited. If we ever care about more, we could add them.

    IMPORTANT: this first signature allows you to specify a sub-selector, and some data to pass. There data parameter is *not* optional -- you must pass something in order for the compiler to pick it up! (At least, put in js.undefined there.) For example, something like:

    $("body").on("click", ".element", js.undefined, { (elem:Element, evt:JQueryEventObject) => {...} )

    We can't write jQuery's (String, String, ThingFunction1) version of the signature here, because it conflicts with the (String, String, Any) version further down, which does something very different. (jQuery is sometimes too clever for its own good.)

    So remember to pass something for the data parameter, in order to get the compiler to do the right thing. If you don't, your function *will* match the (String, String, Any) version of the signature, but it won't work correctly.

  205. def one(eventsMap: Dictionary[EventHandler]): JQuery

    Permalink
  206. def one(eventsMap: Dictionary[EventHandler], selector: String): JQuery

    Permalink
  207. def one(eventsMap: Dictionary[EventHandler], selector: String, data: Any): JQuery

    Permalink
  208. def one(events: String): JQuery

    Permalink
  209. def one(events: String, turnOff: Boolean): JQuery

    Permalink
  210. def one(events: String, selector: String): JQuery

    Permalink
  211. def one(events: String, selector: String, data: Any): JQuery

    Permalink
  212. def one(events: String, selector: String, data: Any, turnOff: Boolean): JQuery

    Permalink
  213. def one(events: String, handler: Function3[JQueryEventObject, Any, Any, Any]): JQuery

    Permalink
  214. def one(events: String, handler: Function2[JQueryEventObject, Any, Any]): JQuery

    Permalink
  215. def one(events: String, handler: ThisFunction3[Element, JQueryEventObject, Any, Any, Any]): JQuery

    Permalink
  216. def one(events: String, handler: ThisFunction2[Element, JQueryEventObject, Any, Any]): JQuery

    Permalink
  217. def one(events: String, handler: EventHandler): JQuery

    Permalink
  218. def one(events: String, selector: String, data: Any, handler: EventHandler): JQuery

    Permalink

    Attach a handler to an event for the elements.

    Attach a handler to an event for the elements. The handler is executed at most once per element per event type.

  219. def outerHeight(includeMargin: Boolean): Double

    Permalink
  220. def outerHeight(): Double

    Permalink

    Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin.

  221. def outerWidth(includeMargin: Boolean): Double

    Permalink
  222. def outerWidth(): Double

    Permalink

    Get the current computed width for the first element in the set of matched elements, including padding, border, and optionally margin.

  223. def parent(): JQuery

    Permalink
  224. def parent(selector: String): JQuery

    Permalink

    Get the parent of each element in the current set of matched elements, optionally filtered by a selector.

    Get the parent of each element in the current set of matched elements, optionally filtered by a selector.

    TBD: is the parameter really a Selector, or just a String? The JQuery API docs are unclear.

  225. def parents(): JQuery

    Permalink
  226. def parents(selector: String): JQuery

    Permalink

    Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector.

  227. def parentsUntil(element: |[Element, JQuery], filter: String = ???): JQuery

    Permalink
  228. def parentsUntil(selector: String, filter: String): JQuery

    Permalink
  229. def parentsUntil(selector: String): JQuery

    Permalink
  230. def parentsUntil(): JQuery

    Permalink

    Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.

  231. def position(): JQueryPosition

    Permalink

    Get the current coordinates of the first element in the set of matched elements, relative to the offset parent.

  232. def prepend(func: ThisFunction2[Element, Int, String, Selector]): JQuery

    Permalink
  233. def prepend(contents: ElementDesc*): JQuery

    Permalink

    Insert content, specified by the parameters, to the beginning of each element in the set of matched elements.

  234. def prependTo(target: ElementDesc): JQuery

    Permalink

    Insert every element in the set of matched elements to the beginning of the target.

  235. def prev(selector: UndefOr[String] = js.undefined): JQuery

    Permalink

    Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector.

  236. def prevAll(selector: UndefOr[String] = js.undefined): JQuery

    Permalink

    Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector.

  237. def prevUntil(element: |[Element, JQuery], filter: String = ???): JQuery

    Permalink
  238. def prevUntil(selector: String, filter: String): JQuery

    Permalink
  239. def prevUntil(selector: String): JQuery

    Permalink
  240. def prevUntil(): JQuery

    Permalink

    Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.

  241. def promise(tpe: String = ???, target: Object = ???): JQueryPromise

    Permalink

    Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished.

  242. def prop(propertyName: String, func: ThisFunction2[Element, Int, Any, Any]): JQuery

    Permalink
  243. def prop(properties: Dictionary[Any]): JQuery

    Permalink
  244. def prop(propertyName: String, value: Any): JQuery

    Permalink

    Set one or more properties for the set of matched elements.

  245. def prop(propertyName: String): UndefOr[Any]

    Permalink

    Get the value of a property for the first element in the set of matched elements.

  246. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  247. def pushStack(elements: Array[Element], name: String, arguments: Array[Any]): JQuery

    Permalink
  248. def pushStack(elements: Array[Element]): JQuery

    Permalink

    Add a collection of DOM elements onto the jQuery stack.

  249. def queue(callback: Function1[Function0[Any], Any]): JQuery

    Permalink
  250. def queue(queueName: String, newQueue: Array[Function]): JQuery

    Permalink
  251. def queue(newQueue: Array[Function]): JQuery

    Permalink
  252. def queue(queueName: String = ???): Array[Function]

    Permalink

    Show the queue of functions to be executed on the matched elements.

  253. def ready(handler: Function0[Any]): JQuery

    Permalink

    Specify a function to execute when the DOM is fully loaded.

  254. def remove(childSelector: String): JQuery

    Permalink
  255. def remove(): JQuery

    Permalink

    Remove the set of matched elements from the DOM.

  256. def removeAttr(attributeName: String): JQuery

    Permalink

    Remove an attribute from each element in the set of matched elements.

  257. def removeClass(func: ThisFunction2[Element, Int, String, String]): JQuery

    Permalink
  258. def removeClass(classNames: String): JQuery

    Permalink
  259. def removeClass(): JQuery

    Permalink

    Remove a single class, multiple classes, or all classes from each element in the set of matched elements.

  260. def removeData(list: Array[String]): JQuery

    Permalink
  261. def removeData(name: String): JQuery

    Permalink
  262. def removeData(): JQuery

    Permalink

    Remove a previously-stored piece of data.

  263. def removeProp(propertyName: String): JQuery

    Permalink

    Remove a property for the set of matched elements.

  264. def replaceAll(target: ElementDesc): JQuery

    Permalink

    Replace each target element with the set of matched elements.

  265. def replaceWith(func: ThisFunction0[Element, ElementDesc]): JQuery

    Permalink
  266. def replaceWith(content: ElementDesc): JQuery

    Permalink

    Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.

  267. def resize(): JQuery

    Permalink
  268. def resize(eventData: Any, handler: EventHandler): JQuery

    Permalink
  269. def resize(func: EventHandler): JQuery

    Permalink

    Bind an event handler to the "resize" JavaScript event, or trigger that event on an element.

  270. def scroll(eventData: Any, handler: EventHandler): JQuery

    Permalink
  271. def scroll(handler: EventHandler): JQuery

    Permalink
  272. def scroll(): JQuery

    Permalink

    Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element.

  273. def scrollLeft(value: |[Double, Integer]): JQuery

    Permalink
  274. def scrollLeft(): Integer

    Permalink

    Get the current horizontal position of the scroll bar for the first element in the set of matched elements.

  275. def scrollTop(value: |[Double, Integer]): JQuery

    Permalink

    Set the current vertical position of the scroll bar for each of the set of matched elements.

    Set the current vertical position of the scroll bar for each of the set of matched elements.

    Note that this intentionally takes Double -- while you usually want to set it to an Int, there are occasions when being able to take a Double (that is, a full JS Number) is convenient in code.

  276. def scrollTop(): Int

    Permalink

    Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element.

  277. def select(eventData: Any, handler: EventHandler): JQuery

    Permalink
  278. def select(handler: EventHandler): JQuery

    Permalink
  279. def select(): JQuery

    Permalink

    Bind an event handler to the "select" JavaScript event, or trigger that event on an element.

  280. def serialize(): String

    Permalink

    Encode a set of form elements as a string for submission.

  281. def serializeArray(): Array[JQuerySerializeArrayElement]

    Permalink

    Encode a set of form elements as an array of names and values.

  282. def show(duration: |[String, Int], easing: String = ???, complete: Function = ???): JQuery

    Permalink
  283. def show(duration: |[String, Int], complete: Function): JQuery

    Permalink
  284. def show(): JQuery

    Permalink

    Hide the matched elements.

  285. def siblings(selector: String = ???): JQuery

    Permalink

    Get the siblings of each element in the set of matched elements, optionally filtered by a selector.

  286. def slice(start: Integer, end: Integer = ???): JQuery

    Permalink

    Reduce the set of matched elements to a subset specified by a range of indices.

  287. def slideDown(duration: |[String, Int], complete: Function = ???): JQuery

    Permalink
  288. def slideDown(): JQuery

    Permalink

    Display the matched elements with a sliding motion.

  289. def slideToggle(options: JQueryAnimationSettings): JQuery

    Permalink
  290. def slideToggle(duration: |[Number, String], easing: String = "swing", complete: ThisFunction0[Element, Any] = ???): JQuery

    Permalink
  291. def slideToggle(): JQuery

    Permalink

    Display or hide the matched elements with a sliding motion.

  292. def slideUp(duration: |[String, Int], complete: Function = ???): JQuery

    Permalink
  293. def slideUp(): JQuery

    Permalink

    Hide the matched elements with a sliding motion.

  294. def stop(queue: String, clearQueue: Boolean = false, jumpToEnd: Boolean = false): JQuery

    Permalink
  295. def stop(clearQueue: Boolean, jumpToEnd: Boolean): JQuery

    Permalink
  296. def stop(clearQueue: Boolean): JQuery

    Permalink
  297. def stop(): JQuery

    Permalink

    Stop the currently-running animation on the matched elements.

  298. def submit(eventData: Any, handler: ThisFunction1[Element, JQueryEventObject, Any]): JQuery

    Permalink
  299. def submit(handler: ThisFunction1[Element, JQueryEventObject, Any]): JQuery

    Permalink
  300. def submit(): JQuery

    Permalink

    Bind an event handler to the "submit" JavaScript event, or trigger that event on an element.

  301. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  302. def text(func: Function2[Int, String, String]): JQuery

    Permalink
  303. def text(t: String): JQuery

    Permalink

    Set the content of each element in the set of matched elements to the specified text.

  304. def text(): String

    Permalink

    Get the combined text contents of each element in the set of matched elements, including their descendants.

  305. def toArray(): Array[Element]

    Permalink

    Retrieve all the elements contained in the jQuery set, as an array.

  306. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  307. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  308. def toggleClass(func: Function3[Integer, String, Boolean, String], state: Boolean): JQuery

    Permalink
  309. def toggleClass(func: Function3[Integer, String, Boolean, String]): JQuery

    Permalink
  310. def toggleClass(state: Boolean): JQuery

    Permalink
  311. def toggleClass(className: String, state: Boolean = ???): JQuery

    Permalink
  312. def toggleClass(): JQuery

    Permalink

    Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the state argument.

  313. def trigger(event: JQueryEventObject, extraParameters: Any*): JQuery

    Permalink
  314. def trigger(eventType: String, extraParameters: Any*): JQuery

    Permalink

    Execute all handlers and behaviors attached to the matched elements for the given event type.

  315. def triggerHandler(event: JQueryEventObject, extraParameters: Any*): JQuery

    Permalink
  316. def triggerHandler(eventType: String, extraParameters: Any*): JQuery

    Permalink

    Execute all handlers attached to an element for an event.

  317. def unbind(eventType: String, handler: ThisFunction1[Element, JQueryEventObject, Any] = ???): JQuery

    Permalink
  318. def unbind(eventType: String, falsing: Boolean): JQuery

    Permalink
  319. def unbind(event: JQueryEventObject): JQuery

    Permalink
  320. def unbind(): JQuery

    Permalink

    Remove a previously-attached event handler from the elements.

  321. def unwrap(): JQuery

    Permalink

    Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.

  322. def update(x: Int, v: Element): Unit

    Permalink

    Shorthand modifier, lifted from scalajs-jquery.

    Shorthand modifier, lifted from scalajs-jquery.

    Annotations
    @JSBracketAccess()
  323. def val(func: Function2[Int, String, String]): JQuery

    Permalink
  324. def val(value: String): JQuery

    Permalink
  325. def val(value: Array[String]): JQuery

    Permalink
  326. def val(): Dynamic

    Permalink

    Get the value of this JQuery.

    Get the value of this JQuery.

    "value" is highly context-dependent. The signature is loose because it can return a String, a Number (?) or an Array, depending on circumstances. See the extension methods in JQueryExtensions for more strongly-typed versions that you can use when you expect a specific return type.

  327. def value(func: Function2[Int, String, String]): JQuery

    Permalink
    Annotations
    @JSName( "val" )
  328. def value(value: String): JQuery

    Permalink
    Annotations
    @JSName( "val" )
  329. def value(value: Array[String]): JQuery

    Permalink
    Annotations
    @JSName( "val" )
  330. def value(): Dynamic

    Permalink
    Annotations
    @JSName( "val" )
  331. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  332. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  333. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  334. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  335. def width(value: ThisFunction2[Element, Integer, Integer, |[Number, String]]): JQuery

    Permalink
  336. def width(value: |[Double, String]): JQuery

    Permalink

    Set the CSS width of every matched element.

  337. def width(): Double

    Permalink

    Get the current computed width for the first element in the set of matched elements.

  338. def wrap(func: ThisFunction1[Element, Integer, |[String, JQuery]]): JQuery

    Permalink
  339. def wrap(wrappingElement: |[|[String, Element], JQuery]): JQuery

    Permalink

    Wrap an HTML structure around each element in the set of matched elements.

  340. def wrapAll(func: ThisFunction1[Element, Integer, |[String, JQuery]]): JQuery

    Permalink
  341. def wrapAll(wrappingElement: |[|[String, Element], JQuery]): JQuery

    Permalink

    Wrap an HTML structure around all elements in the set of matched elements.

  342. def wrapInner(func: ThisFunction1[Element, Integer, |[String, JQuery]]): JQuery

    Permalink
  343. def wrapInner(wrappingElement: |[|[String, Element], JQuery]): JQuery

    Permalink

    Wrap an HTML structure around the content of each element in the set of matched elements.

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped