Java16 - JQuery
Java16 - JQuery
Java16 - JQuery
Lnda: Interneti
Java: XV (e gjashtmbdhjet) - Ushtrime
Tema: JQuery
Prmbajtja:
jQuery:
Hyrje
Sintaksa
Selektort
Ngjarjet (Events)
jQuery Hyrje
jQuery is a lightweight, "write less, do more",
JavaScript library.
The purpose of jQuery is to make it much easier
to use JavaScript on your website.
jQuery also simplifies a lot of the complicated
things from JavaScript, like AJAX calls and DOM
manipulation.
The jQuery library contains the following features:
o
o
o
o
o
o
HTML/DOM manipulation
CSS manipulation
HTML event methods
Effects and animations
AJAX
Utilities
jQuery Sintaksa
The jQuery syntax is tailor made
for selecting HTML elements and performing
some action on the element(s).
Sintaksa bazike eshte: $(selector).action()
o Shenja $ per te definuar/qasur jQuery
o Nje (selector) per query (ose per te gjetur)
HTML elementet
o Nje jQuery action() qe duhet te aplikohet tek
elementet
});
jQuery Selektort
jQuery selectors allow you to select and
manipulate HTML element(s).
The element Selector
$("p")
The #id Selector
The jQuery #id selector uses the id attribute of an
HTML tag to find the specific element.
$("#test")
The .class Selector
The jQuery class selector finds elements with a
specific class.
$(".test")
Sintaksa:
$("p").click();
$("p").click(function(){
// action goes here!!
});
jQuery Efektet
jQuery hide() and show()
jQuery toggle()
fadeIn()
fadeOut()
fadeToggle()
fadeTo()
jQuery Animacionet
jQuery HTML
jQuery Get/Set
o text() - Sets or returns the text content of selected elements
o html() - Sets or returns the content of selected elements (including
HTML markup)
o val() - Sets or returns the value of form fields
jQuery Add/Remove
o append() - Inserts content at the end of the selected elements
o prepend() - Inserts content at the beginning of the selected
elements
o after() - Inserts content after the selected elements
o before() - Inserts content before the selected elements
o remove() - Removes the selected element (and its child elements)
o empty() - Removes the child elements from the selected element