@haxall/haxall
    Preparing search index...

    Class Link

    Hyperlink anchor element

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    type$: Type

    Methods

    • Add a new element as a child to this element. Return this.

      Parameters

      Returns this

    • Add all elements to this element. Returns this.

      Parameters

      Returns this

    • Start an animation on this element using the given key frames.

      frames := KeyFrames([
      KeyFrame("0%", ["transform": "scale(1)"]),
      KeyFrame("50%", ["transform": "scale(1.1)"]),
      KeyFrame("100%", ["transform": "scale(1)"]),
      ])

      animate(frames, null, 5sec)
      animate(frames, ["animation-iteration-count":"infinite"], 1sec)

      Parameters

      Returns void

    • Stop the current animation on this element, or do nothing if no animation in progress.

      Returns void

    • Get the given HTML attribute value for this element. Returns null if attribute not defined.

      Parameters

      • name: string

      Returns string

    • Get name:value map of all attributes.

      Returns Map<string, string>

    • Remove focus from this elem.

      Returns void

    • Get the child nodes of this element.

      Returns List<Elem>

    • Return a duplicate of this node.

      Parameters

      • Optionaldeep: boolean

      Returns Elem

    • Traverses this element and its parents (heading toward the document root) until it finds a node that matches the specified CSS selector. Returns null if none found.

      Parameters

      • selectors: string

      Returns Elem

    • Return a negative integer, zero, or a positive integer if this object is less than, equal to, or greater than the specified object:

      this < that   =>  <0
      this == that => 0
      this > that => >0

      This method may also be accessed via the < <= <=> >= and > shortcut operators. If not overridden the default implementation compares the toStr representations. Also see docLang.

      Examples:

      3.compare(8)  =>  -1
      8.compare(3) => 1
      8.compare(8) => 0
      3 <=> 8 => -1 // shortcut for 3.compare(8)

      Parameters

      Returns number

    • Return true if given element is a descendant of this node, or false if not.

      Parameters

      Returns boolean

    • The enabled attribute for this element, or null if one not applicable. This is typically only valid for form elements.

      Returns boolean

    • The enabled attribute for this element, or null if one not applicable. This is typically only valid for form elements.

      Parameters

      • it: boolean

      Returns void

    • Compare this object to the specified for equality. This method may be accessed via the == and != shortcut operators. If not overridden the default implementation compares for reference equality using the === operator. If this method is overridden, then hash() must also be overridden such that any two objects which return true for equals() must return the same value for hash(). This method must accept null and return false.

      Parameters

      Returns boolean

    • Get the first child node of this element, or null if this element has no children.

      Returns Elem

    • Request keyboard focus on this elem.

      Returns void

    • Convenience for attr.

      Parameters

      • name: string

      Returns JsObj

    • Return true if children is non-zero, false otherwise.

      Returns boolean

    • Return true if this elem has focus.

      Returns boolean

    • Return a unique hashcode for this object. If a class overrides hash() then it must ensure if equals() returns true for any two objects then they have same hash code.

      Returns number

    • The HTML markup contained in this element.

      Returns string

    • The HTML markup contained in this element.

      Parameters

      • it: string

      Returns void

    • The id for this element. Returns null if id is not defined.

      Returns string

    • The id for this element. Returns null if id is not defined.

      Parameters

      • it: string

      Returns void

    • Insert a new element as a child to this element before the specified reference element. The reference element must be a child of this element. Returns this.

      Parameters

      Returns this

    • Invoke the given native DOM function with optional arguments.

      Parameters

      Returns JsObj

    • Return if this Obj is immutable and safe to share between threads:

      • an instance of a const class
      • the result of toImmutable on List, Map, or Buf
      • a Func object may or may not be immutable - see sys::Func.
      • other instances are assumed mutable and return false

      Returns boolean

    • Get the last child node of this element, or null if this element has no children.

      Returns Elem

    • Get the next sibling to this element, or null if this is the last element under its parent.

      Returns Elem

    • The namespace URI of this element.

      Returns Uri

    • Attach an event handler for the given event on this element. Returns callback function instance.

      Parameters

      • type: string
      • useCapture: boolean
      • handler: (arg0: Event) => void

      Returns Function

    • Position of element relative to the whole document.

      Returns Point

    • Get the parent Elem of this element, or null if this element has no parent.

      Returns Elem

    • Position of element relative to its parent in pixels.

      Returns Point

    • Position of element relative to its parent in pixels.

      Parameters

      Returns void

    • Get the previous sibling to this element, or null if this is the first element under its parent.

      Returns Elem

    • Get the given DOM property value for this element. Returns null if property does not exist.

      Parameters

      • name: string

      Returns JsObj

    • Returns the first element that is a descendant of this element on which it is invoked that matches the specified group of selectors.

      Parameters

      • selectors: string

      Returns Elem

    • Returns a list of all elements descended from this element on which it is invoked that match the specified group of CSS selectors.

      Parameters

      • selectors: string

      Returns List<Elem>

    • Given a page position, return p relative to this element.

      Parameters

      Returns Point

    • Remove a child element from this element. Return this.

      Parameters

      Returns this

    • Remove all children from this element. Returns this.

      Returns this

    • Remove the given HTML attribute from this element.

      Parameters

      • name: string

      Returns this

    • Remove the given event handler from this element. If this handler was not registered, this method does nothing.

      Parameters

      • type: string
      • useCapture: boolean
      • handler: Function

      Returns void

    • Paint a <canvas> element. The given callback is invoked with a graphics context to perform the rendering operation. Before calling this code, you should set the canvas width/height attributes to match the element size (typically as a ratio of the Win.devicePixelRatio).

      Parameters

      Returns void

    • Replace existing child node with a new child. Returns this.

      Parameters

      Returns this

    • Scroll parent container so this Elem is visible to user. If alignToTop is true (the default value), the top of Elem is aligned to top of the visible area. If false, the bottom of Elem is aligned to bottom of the visible area.

      Parameters

      • OptionalalignToTop: boolean

      Returns this

    • Top left scroll position of element.

      Returns Point

    • Top left scroll position of element.

      Parameters

      Returns void

    • Scrollable size of element.

      Returns Size

    • Conveneince for setAttr.

      Parameters

      • name: string
      • val: string

      Returns void

    • Set the given HTML attribute value for this element. If val is null the attribute is removed (see removeAttr). Optionally a namespace can be specified with ns.

      Parameters

      • name: string
      • val: string
      • Optionalns: Uri

      Returns this

    • Set the given DOM properity value for this element.

      Parameters

      Returns this

    • Size of element in pixels.

      Returns Size

    • Size of element in pixels.

      Parameters

      Returns void

    • Get the Style instance for this element.

      Returns Style

    • Get the tag name for this element.

      Returns string

    • The target attribute specifies where to open the linked document.

      Returns string

    • The target attribute specifies where to open the linked document.

      Parameters

      • it: string

      Returns void

    • Text content contained in this element.

      Returns string

    • Text content contained in this element.

      Parameters

      • it: string

      Returns void

    • Get an immutable representation of this instance or throw NotImmutableErr if this object cannot be represented as an immutable:

      • if type is const, return this
      • if already an immutable List, Map, Buf, or Func return this
      • if a List, then attempt to perform a deep clone by calling toImmutable on all items
      • if a Map, then attempt to perform a deep clone by calling toImmutable on all values (keys are already immutable)
      • some Funcs can be made immutable - see sys::Func
      • if a Buf create immutable copy, see sys::Buf
      • any other object throws NotImmutableErr

      Returns Readonly<this>

    • Return a string representation of this object.

      Returns string

    • Transition a set of CSS properties.

      transition(["opacity": "0.5"], null, 1sec) { echo("done!") }
      transition(["opacity": "0.5"], ["transition-delay": 500ms], 1sec) { echo("done!") }

      Parameters

      Returns void

    • The trap operator will behave slightly differently based on the namespace of the element.

      For HTML elements, trap works as a convenience for prop and setProp:

      div := Elem("div")
      div->tabIndex = 0 // equivalent to div.setProp("tabIndex", 0)

      For SVG elements (where ns is http://www.w3.org/2000/svg), trap routes to attr and setAttr:

      svg := Svg.line(0, 0, 10, 10)
      svg->x1 = 5 // equivalent to svg.setAttr("x1", "5")
      svg->y1 = 5 // equivalent to svg.setAttr("y1", "5")
      svg->x2 == "10" // equivalent to svg.attr("x2")

      Parameters

      Returns JsObj

    • Get the Type instance which represents this object's class. Also seeType.of or Pod.of.

      Returns Type

    • URI to hyperlink to.

      Returns Uri

    • URI to hyperlink to.

      Parameters

      Returns void

    • This method called whenever an it-block is applied to an object. The default implementation calls the function with this, and then returns this.

      Parameters

      • f: (arg0: this) => void

      Returns this

    • Write x.toStr to standard output followed by newline. If x is null then print "null". If no argument is provided then print an empty line.

      Parameters

      Returns void

    • Create an Elem instance from a HTML string. This is equivlaent

      elem := Elem { it.html=html }.firstChild
      

      Parameters

      • html: string

      Returns Elem

    • Create an Elem instance from a native JavaScript DOM object. The type may be specified to create a subclass instance of Elem. Note if the native instance has already been mapped to Fantom, the existing instance is returned and type will have no effect.

      Parameters

      • elem: any
      • Optionaltype: Type

      Returns Elem

    • Create a new Elem in the current Doc. Optionally a namespace can be specified with ns.

      Parameters

      • ...args: unknown[]

      Returns Link