Documente Academic
Documente Profesional
Documente Cultură
JQUERY
DISERTANTE
ING. RASJIDO, JOSE ALBERTO
Introduccin a JQuery 2
Qu es JQUERY?
jQuery
$
Introduccin a JQuery 4
$().ready(
function(){
);
Introduccin a JQuery 5
2) Estilo CSS
3) Eventos
4) Efectos
5) AJAX
Introduccin a JQuery 7
Ejemplo:
$(#enlace).attr(href,http://www.google.com.ar).attr(tit
le,Enlace a Google);
Introduccin a JQuery 8
Ejemplo:
$(#enlace).attr(
{href:http://www.google.com.ar,title:Enlace a Google}
);
Introduccin a JQuery 9
removeAttr ( nombre_atributo )
Ejemplo:
$(#enlace).removeAttr(title);
Introduccin a JQuery 10
html( [ nombre_elemento ])
Ejemplo:
alert( $(#enlace).html() );
Ejemplo:
$(#enlace).after(<a href=http://www.yahoo.com.ar>Ir a
Yahoo</a>);
Introduccin a JQuery 12
2) Estilo CSS
3) Eventos
4) Efectos
5) AJAX
Introduccin a JQuery 15
height /width
height / width Entero en pxeles
removeClass String como nombre de clase
Introduccin a JQuery 16
Ejemplo .css()
$("#enlace").css("text-decoration","none").css("color","red");
$("#enlace").css({"text-decoration":"none","color":"red"});
Introduccin a JQuery 17
$("#enlace").hover(
function(){ $(this).css({"color":"green"}) },
function(){ $(this).css({"color":"red"}) }
);
Introduccin a JQuery 18
2) Estilo CSS
3) Eventos
4) Efectos
5) AJAX
Introduccin a JQuery 19
.bind(nombre_evento, funcion)
$("img").bind( mouseover",
function(){
});
$("img").bind( "mouseout",
function(){
$(this).css({"border":"0px","box-shadow":"none"});
});
Introduccin a JQuery 22
$("img").mouseover(function(){
});
$("img").mouseout(function(){
$(this).css({"border":"0px","box-shadow":"none"});
});
Introduccin a JQuery 23
$(img).unbind();
Introduccin a JQuery 24
$(img).unbind(mouseover mouseout);
Introduccin a JQuery 25
$(#botonSubmit).unbind(click, enviarFormulario);
Introduccin a JQuery 26
2) Estilo CSS
3) Eventos
4) Efectos
5) AJAX
Introduccin a JQuery 27
.show()
.hide()
Ejemplo:
$("img").hide();
$("img").fadeIn(2000);
$("img").mouseover(function(){$(this).fadeTo(1000,0.5);});
$("img").mouseout(function(){$(this).fadeTo(1000,1);});
Introduccin a JQuery 30
Encadenamiento de funciones
Encadenamiento de funciones
Ejemplo simplificado:
$("img").hide()
.fadeIn(2000)
.mouseover(function(){$(this).fadeTo(1000,0.5);})
.mouseout(function(){$(this).fadeTo(1000,1);});
Introduccin a AJAX 32
EJERCICIOS