• Nie Znaleziono Wyników

Michał OkulewiczWarsaw University of TechnologyFaculty of Mathematics and Information ScienceM.Okulewicz@mini.pw.edu.pl JavaScript: jQuery

N/A
N/A
Protected

Academic year: 2021

Share "Michał OkulewiczWarsaw University of TechnologyFaculty of Mathematics and Information ScienceM.Okulewicz@mini.pw.edu.pl JavaScript: jQuery"

Copied!
6
0
0

Pełen tekst

(1)

JavaScript: jQuery

Michał Okulewicz

Warsaw University of Technology

Faculty of Mathematics and Information Science

(2)

jQuery: introduction

jQuery is a JavaScript library dedicated to easier operations on several HTML DOM elements in one function

Current version

1.x – supports IE 6, 7 and 8

2.x – does not support IE 6,7 and 8

jQuery hides browser specific functions and

(3)

jQuery: basic query

jQuery utilizes CSS selectors in $() function

$('li') instead of

document.getElementsByTagName('li')

$('ol ul li') instead of

very long plain JS code

(4)

jQuery

Applications

Applying styles/classes to all selected elements

Attaching events to all selected elements http://api.jquery.com/category/events/event-

object/

Animating selected elements

(5)

CSS styles and classes

$(selector/element).addClass(class)

$(selector/element).removeClass(class)

$(selector/element).css(style name, value)

(6)

JS events

$(selector/element).click(handler)

$(selector/element).submit(handler)

$(selector/element).keypress(handler) etc.

Cytaty

Powiązane dokumenty

W efekcie ma powstać strona html (wykorzystująca technologie html+css+jQuery) pozwalająca dodawać/usuwać na stronie elementy typu DIV (które układają się sąsiadując –

Jak widać treść strony została zablokowana (podpowiedź: stało się tak, ponieważ powiększone zdjęcie wyświetliło się w DIVie, który ‘przykrył’ całą zawartość strony

– The task of the developer is to define the data necessary to compute a given value – One may think about it as an event-.

– Clear error messages referring to other recently opened documents first – Recreate the error condition and observe the error details. • Sample

• Since the JS code is interpreted by the web browser and may be used to modify HTML document it may help reduce the volume of server-side processing, thus:.

• One of the key assumptions of DOM is that using DOM interfaces web developer can programmatically create or modify the whole document (in particular HTML

HTML5 specification introduced (finally?) multimedia and more interactive content into HTML elements?.

Using Navigator objects Navigator object hierarchy document properties: an example JavaScript reflection and HTML layout Key Navigator objects. Navigator's