Extends
Classes
Methods
(static) addFn(name, fn) → {Fascino}
Añade funciones a Fascino
| Name | Type | Description | 
|---|---|---|
name | String | Nombre de la función  | 
fn | function | Función a asignar  | 
- Type:
 - Fascino
 
(static) border(val, pseudo) → {Object|Fascino}
Obtiene o Establece el relleno del Elemento dado
| Name | Type | Description | 
|---|---|---|
val | String | | Valor del Elemento a establecer  | 
pseudo | String | Important  | 
- Type:
 - Object |
Fascino  
(static) margin(val, pseudo) → {Object|Fascino}
Obtiene o Establece el relleno del Elemento dado
| Name | Type | Description | 
|---|---|---|
val | String | | Valor del Elemento a establecer  | 
pseudo | String | Important  | 
- Type:
 - Object |
Fascino  
(static) padding(val, pseudo) → {Object|Fascino}
Obtiene o Establece el relleno del Elemento dado
| Name | Type | Description | 
|---|---|---|
val | String | | Valor del Elemento a establecer  | 
pseudo | String | Important  | 
- Type:
 - Object |
Fascino  
addClass(…arg) → {Fascino}
Agrega clases al elemento dado
| Name | Type | Attributes | Description | 
|---|---|---|---|
arg | String | <repeatable> | Lista de clases separadas por coma(,)  | 
- Type:
 - Fascino
 
_$(mi-elem).addClass('miclass')
_$(mi-elem).addClass('miclass1', 'miclass2' /*...*\)adopt() → {Array}
Transfiere un node desde otro document al documento del método
- Type:
 - Array
 
after(html, position) → {Fascino}
Agrega un elemento o etiquetas HTML después del elemento dado
| Name | Type | Default | Description | 
|---|---|---|---|
html | String | | ||
position | String | afterbegin | la posición equivale a afterbegin o afterend; @default afterbegin  | 
- Type:
 - Fascino
 
append(node, options) → {Fascino}
Agrega un elemento al padre seleccionado
| Name | Type | Description | 
|---|---|---|
node | Element | | |
options | Object | 
- Type:
 - Fascino
 
appendTo(node, options) → {Fascino}
Agrega el elemento seleccionado al nuevo padre
| Name | Type | Description | 
|---|---|---|
node | Element | | |
options | Object | 
- Type:
 - Fascino
 
attr(…args) → {String|Array|Object|Fascino}
Obtiene o Establece los Atributos de un elemento
| Name | Type | Attributes | Description | 
|---|---|---|---|
args | String | | <repeatable> | 
- Type:
 - String |
Array | Object | Fascino  
Uso
miElement.attr('name', 'paswd') // Establece el Atributo Name a passwd
miElement.attr({
  id:'miElementID', // Establece el Id a miElementID y cambia el placeholder
  placeholder:'Escribe Aquí'
})
miElement.attr() // Re-establece los Atributos y retorna un NodeMap con ellos en caso de no poseer atributos retornara un Objecto Fascino
miElement.attr('name') // Retorna 'passwd' o false
miElement.attr(['name', 'id']) // Retorna un objecto {miElementID: {name: 'passwd', id:'miElementID'}}
// Ademas podemos pasar una función que se invocara dentro de un bucle que recorre los atributos
miElement.attr( function(attrName, attrValue, Attr) {
  console.log(
      this, // El Elemento iterado
      attrName, // El nombre del atributo
      attrValue, // El Valor del Attributo
      Attr // Lista de todos los atributos
)
})before(html, position) → {Fascino}
Agrega un elemento o HTML antes del elemento dado
| Name | Type | Default | Description | 
|---|---|---|---|
html | String | | ||
position | String | beforebegin | la posición equivale a beforebegin o beforeend; @default beforebegin  | 
- Type:
 - Fascino
 
children(sel) → {Array}
Obtiene los hijos de un elemento
| Name | Type | Description | 
|---|---|---|
sel | String | | Selector o elemento hijo a buscar  | 
Lista de hijos
- Type:
 - Array
 
cleanAttr() → {Fascino}
Elimina todos los atributos de un elemento
- Type:
 - Fascino
 
clone(deep) → {Array}
Clona el elemento seleccionado
| Name | Type | Default | Description | 
|---|---|---|---|
deep | Boolean | false | Verdadero si los hijos del nodo también deben ser clonados  | 
- Type:
 - Array
 
closest(sel) → {Fascino|Element|Array|Null}
Busca el ascendiente más cercano al elemento seleccionado
| Name | Type | Description | 
|---|---|---|
sel | String | | Selector del ascendiente a buscar  | 
- Type:
 - Fascino |
Element | Array | Null  
contains(s) → {Boolean}
Verifica si el elemento es hijo del Elemento seleccionado
| Name | Type | Description | 
|---|---|---|
s | String | | Selector CSS  | 
- Type:
 - Boolean
 
contents() → {Array}
Obtiene el contenido de un Iframe o Template
- Type:
 - Array
 
data(…args) → {String|Array|Object|Fascino}
Establece u Obtiene los datos del Elemento Dataset
| Name | Type | Attributes | Description | 
|---|---|---|---|
args | String | | <repeatable> | 
- Type:
 - String |
Array | Object | Fascino  
Uso
miElement.data('role', 'dialog')  // Establece el Rol a dialog
// Esteble al data-json al objecto dado
miElement.data({
  json:{
     a: 1,
     b: 2
}
})
miElement.data() // Retorna un Objecto con todos los datos del Atributo data
miElement.data('role') // Retorna Dialog
miElement.data(['role','json']) // Retornara un Objecto {miElementID: {role: 'dialog', json: {a:1,b:2}}}each(…arg) → {Fascino}
Recorre los elementos
| Name | Type | Attributes | Description | 
|---|---|---|---|
arg | function | | <repeatable> | Argumentos  | 
- Type:
 - Fascino
 
emptyHtml() → {Fascino}
Vacía el contenido HTML de un elemento
- Type:
 - Fascino
 
emptyVal() → {Fascino}
Vacía el valor de un elemento
- Type:
 - Fascino
 
eq(i) → {Fascino}
Busca, valida y obtiene el elemento dado por su posición dentro de la matriz de elementos
| Name | Type | Description | 
|---|---|---|
i | Number | posición del elemento  | 
- Type:
 - Fascino
 
even() → {Element|Fascino}
Obtiene los numero pares de la matriz
- Type:
 - Element |
Fascino  
fadeIn(fn, time) → {Fascino}
Muestra un elemento con desvanecimiento suave
| Name | Type | Default | Description | 
|---|---|---|---|
fn | function | Funcion a ejecutar despues del efecto  | |
time | Number | 600 | Tiempo del desvanecimiento  | 
- Type:
 - Fascino
 
fadeOut(fn, time) → {Fascino}
Funcion que Oculta con un desvanecimiento suave
| Name | Type | Default | Description | 
|---|---|---|---|
fn | function | Función a ejecutar luego de ocultar  | |
time | Number | 600 | Tiempo del desvanecimiento  | 
- Type:
 - Fascino
 
filter(fn) → {Fascino}
Crea una nueva selección de elemento que cumplan con la condición dada en la función
| Name | Type | Description | 
|---|---|---|
fn | function | Función para filtrar  | 
- Type:
 - Fascino
 
find(sel) → {Fascino}
Busca un elemento hijo por su selector CSS
| Name | Type | Description | 
|---|---|---|
sel | String | | Selector CSS valido  | 
- Type:
 - Fascino
 
fire(name, data) → {void|Fascino}
Dispara o Crea un Evento Personalizado
| Name | Type | Description | 
|---|---|---|
name | String | Nombre del Evento  | 
data | Object | Información del Evento  | 
- Type:
 - void |
Fascino  
first() → {Element}
Obtiene el primer elemento de la matriz
- Type:
 - Element
 
get(i) → {Element}
Obtiene el Elemento solicitado por su posición dentro de la matriz de Elementos, El Elemeto obtenido es de tipo Element
| Name | Type | Description | 
|---|---|---|
i | Number | Posición  | 
- Type:
 - Element
 
getEvent(name, index) → {Object}
Obtiene las lista de eventos asignados aun elemento, si no se pasa ningun argumento se obtendran todos los eventos
| Name | Type | Description | 
|---|---|---|
name | String | Nombre del Evento  | 
index | Number | Posición del evento a buscar  | 
- Type:
 - Object
 
hasAttr(attr) → {Boolean}
Verifica si el elemento tiene el atributo dado
| Name | Type | Description | 
|---|---|---|
attr | String | 
- Type:
 - Boolean
 
hasClass(className) → {Boolean}
Verifica si el elemento posee una clase
| Name | Type | Description | 
|---|---|---|
className | String | Nombre de la clase  | 
Verdadero si existe
- Type:
 - Boolean
 
hasData(key) → {Boolean}
Verifica si el Elemento tiene un atributo data dado
| Name | Type | Description | 
|---|---|---|
key | String | Nombre sin el data  | 
- Type:
 - Boolean
 
height(val) → {Number|String|Fascino}
Obtiene o establece la altura del elemento
| Name | Type | Description | 
|---|---|---|
val | Number | | 
- Type:
 - Number |
String | Fascino  
hide(callback) → {Fascino}
Oculta un ELemento y ejecuta la función dada
| Name | Type | Description | 
|---|---|---|
callback | function | 
- Type:
 - Fascino
 
hover(fnOver, fnOut) → {Fascino}
Crea el evento hover
| Name | Type | Description | 
|---|---|---|
fnOver | function | Función de entrada  | 
fnOut | function | Función de Salida  | 
- Type:
 - Fascino
 
html(html) → {Fascino|String}
Obtiene o Establece el contenido HTML del elemento seleccionado
| Name | Type | Description | 
|---|---|---|
html | String | | 
- Type:
 - Fascino |
String  
import(deep) → {Array}
Crea una copia de un nodo desde un documento externo
| Name | Type | Default | Description | 
|---|---|---|---|
deep | Boolean | true | Verdadero si los hijos del nodo también deben ser importados  | 
- Type:
 - Array
 
index(parent, nodeName) → {Number}
Obtiene la posición del elemento dentro de su padre
| Name | Type | Description | 
|---|---|---|
parent | Element | | El padre de los Elementos  | 
nodeName | String | tipo de nombre de nodo entre los cuales buscar  | 
- Type:
 - Number
 
innerHeight() → {Number}
Obtiene el Alto interno del elemento
- Type:
 - Number
 
innerWidth() → {Number}
Obtiene el Ancho interno del elemento
- Type:
 - Number
 
insertAfter(elements) → {Fascino}
Inserta un elemento después del elemento seleccionado
| Name | Type | Description | 
|---|---|---|
elements | Element | 
- Type:
 - Fascino
 
insertBefore(elements) → {Fascino}
Inserta un elemento antes del elemento seleccionado
| Name | Type | Description | 
|---|---|---|
elements | Element | 
- Type:
 - Fascino
 
is(s) → {Boolean}
Verifica de que tipo es el selector
| Name | Type | Description | 
|---|---|---|
s | * | 
- Type:
 - Boolean
 
last() → {Element}
Obtiene el ultimo elemento de la matriz
- Type:
 - Element
 
left(v, m) → {String|Number|NaN}
Obtiene o Establece la posición horizontal del elemento
| Name | Type | Default | Description | 
|---|---|---|---|
v | String | | Nueva posición  | |
m | Boolean | false | Si se debe incluir el margen  | 
- Type:
 - String |
Number | NaN  
map(callback) → {Array}
Crea una nueva matriz de elementos a través de la función dada
| Name | Type | Description | 
|---|---|---|
callback | function | Función  | 
- Type:
 - Array
 
matches(selectorString) → {Element|Array}
Verifica si el elemento es seleccionable por el Selector
| Name | Type | Description | 
|---|---|---|
selectorString | String | Selector CSS  | 
- Type:
 - Element |
Array  
merge(els) → {Fascino}
Combina Elementos
| Name | Type | Description | 
|---|---|---|
els | Array | Matriz de elementos nueva  | 
- Type:
 - Fascino
 
next(sel) → {Fascino|Array}
Obtiene o busca el hermano siguiente
| Name | Type | Description | 
|---|---|---|
sel | String | | 
- Type:
 - Fascino |
Array  
odd() → {Element|Fascino}
Obtiene los elementos impares de la matriz
- Type:
 - Element |
Fascino  
off(eventsList, sel, handler, options, ix) → {Fascino}
Desvincula el Evento para un elemento
| Name | Type | Description | 
|---|---|---|
eventsList | String | El nombre del Evento  | 
sel | String | Namespace o selector  | 
handler | function | Función a ejecutar  | 
options | Object | Opciones de AddEventListiner  | 
ix | Number | Index del evento  | 
- Type:
 - Fascino
 
offset(val) → {Object|Fascino}
Obtiene o Establece la posición del Elemento
| Name | Type | Description | 
|---|---|---|
val | Object | Objeto {top,left}  | 
- Type:
 - Object |
Fascino  
on(eventsList, sel, handler, options) → {Fascino}
Establece el Evento para un elemento
Si va usar eventos estándar es mejor que use los de la lista _$().click(), $().blur() ...
| Name | Type | Description | 
|---|---|---|
eventsList | String | | El nombre del Evento  | 
sel | String | Namespace o selector  | 
handler | function | Función a ejecutar  | 
options | Object | Opciones de AddEventListiner  | 
- Type:
 - Fascino
 
one(events, sel, handler, options) → {Fascino}
Ejecuta el evento solo para el primer evento dado
| Name | Type | Description | 
|---|---|---|
events | String | El evento  | 
sel | String | Namespace o selector  | 
handler | function | Función a ejecutar  | 
options | Object | Opciones de AddEventListiner  | 
- Type:
 - Fascino
 
outerHeight(val) → {String|Number|Fascino}
Obtiene o Establece la Altura total del elemento
| Name | Type | Description | 
|---|---|---|
val | String | | 
- Type:
 - String |
Number | Fascino  
outerHTML() → {String}
Obtiene el HTML o envoltura del elemento dado
- Type:
 - String
 
outerWidth(val) → {String|Number|Fascino}
Obtiene o Establece el Ancho total del elemento
| Name | Type | Description | 
|---|---|---|
val | String | | 
- Type:
 - String |
Number | Fascino  
parent() → {Fascino}
Obtiene el padre del elemento
- Type:
 - Fascino
 
parents(sel) → {Fascino}
Obtiene el o los padres de un elemento
| Name | Type | Description | 
|---|---|---|
sel | String | | Selector del padre a buscar  | 
Lista de Padres
- Type:
 - Fascino
 
position(margin) → {Object|Undefined}
Obtiene la Posición del elemento
| Name | Type | Default | Description | 
|---|---|---|---|
margin | Boolean | false | Verdader si se incluye el margen  | 
- Type:
 - Object |
Undefined  
prepend(node, options) → {Fascino}
Agrega un nuevo elemento al principio del padre seleccionado
| Name | Type | Description | 
|---|---|---|
node | Element | | |
options | Object | 
- Type:
 - Fascino
 
prependTo(node, options) → {Fascino}
Agrega el elemento seleccionado al nuevo padre
| Name | Type | Description | 
|---|---|---|
node | Element | | |
options | Object | 
- Type:
 - Fascino
 
prev(sel) → {Fascino|Array}
Obtiene o busca el hermano anterior
| Name | Type | Description | 
|---|---|---|
sel | String | | 
- Type:
 - Fascino |
Array  
prop(n, v) → {Fascino}
Método público de Fascino._prop
| Name | Type | Description | 
|---|---|---|
n | String | |
v | String | 
- Type:
 - Fascino
 
remove(sel) → {Array}
Elimina uno o todos los elementos del DOM
| Name | Type | Description | 
|---|---|---|
sel | String | | Selector a eliminar  | 
- Type:
 - Array
 
removeAttr(…args) → {Fascino}
Remueve los atributos dados
| Name | Type | Attributes | Description | 
|---|---|---|---|
args | String | <repeatable> | Lista de Atributos  | 
- Type:
 - Fascino
 
miElement.removeAttr('style', 'name')removeClass(…args) → {Fascino}
Elimina Clases del elemento seleccionado
| Name | Type | Attributes | Description | 
|---|---|---|---|
args | String | <repeatable> | 
- Type:
 - Fascino
 
removeData(…keys) → {Fascino}
Remueve los Atributos data
| Name | Type | Attributes | Description | 
|---|---|---|---|
keys | String | <repeatable> | Lista de nombres de data sin el data  | 
- Type:
 - Fascino
 
// <input id="miElement" data-role='pick' data-color="#fff">
_$('#miElement').removeData('role', 'color');
// Obtendremos
// <input id="miElement">removeStyle(…name) → {Fascino}
Remueve todos o los estilos establecidos
| Name | Type | Attributes | Description | 
|---|---|---|---|
name | String | <repeatable> | Lista de Stilo}  | 
- Type:
 - Fascino
 
miElement.removeStyle('border', 'color') // Removerá los estilos del border y el colorreplaceClass(…args) → {Fascino}
Reemplaza una clase por otra
| Name | Type | Attributes | Description | 
|---|---|---|---|
args | String | <repeatable> | Clase vieja clase nueva  | 
- Type:
 - Fascino
 
miElement.replaceClass('oldClass', 'NewClass')scrollLeft(val) → {String|Number|Fascino}
Obtiene o estable el valor de la barra de desplazamiento Horizontal
| Name | Type | Description | 
|---|---|---|
val | String | | 
- Type:
 - String |
Number | Fascino  
scrollTop(val) → {String|Number|Fascino}
Obtiene o estable el valor de la barra de desplazamiento vertical
| Name | Type | Description | 
|---|---|---|
val | String | | 
- Type:
 - String |
Number | Fascino  
show(callback) → {Fascino}
Muestra un elemento y ejecuta la función dada
| Name | Type | Description | 
|---|---|---|
callback | function | 
- Type:
 - Fascino
 
style(…arg) → {Fascino|Array|Object|String}
Agrega u Obtiene estilos CSS a los Elementos
| Name | Type | Attributes | Description | 
|---|---|---|---|
arg | String | | <repeatable> | 
- Type:
 - Fascino |
Array | Object | String  
Uso
miElement.style('display', 'none') // establece la propiedad CSS a display none
miElement.style({
  border: '1px solid #ff0' // Establece un border Amarillo
  color: '#000' // y un color de texto Negro
})
miElement.style('display') // retorna none
miElement.style() // Retorna todos los Estilos establecidos(CSSStyleDeclaration)
miElement.style([
  'border', 'color' // Retorna un Objecto {IDfromMiElem: {border: '1px solid #ff0', color: '#000'}}
]) // Importante: si el elemento no tiene ID se le creara uno aleatoriotext(txt) → {Fascino|String}
Obtiene o Establece el texto al elemento seleccionado
| Name | Type | Description | 
|---|---|---|
txt | String | | 
- Type:
 - Fascino |
String  
toggleAttr(name, value) → {Fascino}
Alterna los Atributos y su valor
| Name | Type | Description | 
|---|---|---|
name | String | Nombre del Atributo  | 
value | String | Valor d el Atributo  | 
- Type:
 - Fascino
 
toggleClass(…args) → {Fascino}
Intercambia clases del elemento dado
| Name | Type | Attributes | Description | 
|---|---|---|---|
args | String | <repeatable> | Lista de Clases a cambiar  | 
- Type:
 - Fascino
 
toggleData(name, value) → {Boolean|String|Object|Array|Fascino}
Alterna entre los atributos data
| Name | Type | Description | 
|---|---|---|
name | String | Nombre del Atributo sin el data  | 
value | String | | Valor del atributo data  | 
- Type:
 - Boolean |
String | Object | Array | Fascino  
top(v, m) → {String|Number|NaN}
Obtiene o Establece la posición vertical del elemento
| Name | Type | Default | Description | 
|---|---|---|---|
v | String | | Nueva posición  | |
m | Boolean | false | Si se debe incluir el margen  | 
- Type:
 - String |
Number | NaN  
trigger(name, data) → {Fascino}
Dispara un evento
| Name | Type | Description | 
|---|---|---|
name | String | Nombre del Evento  | 
data | Object | Información del evento  | 
- Type:
 - Fascino
 
unwrap() → {Fascino}
Desencierra los elemento
- Type:
 - Fascino
 
val(value) → {Fascino|String}
Obtiene o Establece el valor de un elemento dado
| Name | Type | Description | 
|---|---|---|
value | String | Valor del input, textarea o elemento que contenta value  | 
- Type:
 - Fascino |
String  
width(val) → {Number|String|Fascino}
Obtiene o establece la anchura del elemento
| Name | Type | Description | 
|---|---|---|
val | Number | | 
- Type:
 - Number |
String | Fascino  
wrap(el) → {Fascino}
Encierra un elemento
| Name | Type | Description | 
|---|---|---|
el | Element | | 
El nuevo padre
- Type:
 - Fascino
 
wrapAll(el) → {Fascino}
Busca y encierra todos los elemento del tipo dado
| Name | Type | Description | 
|---|---|---|
el | NodeList | | 
- Type:
 - Fascino
 
wrapInner(el) → {Fascino}
Busca y encierra los hijo de un elemento
| Name | Type | Description | 
|---|---|---|
el | Elemento | | 
- Type:
 - Fascino