Upgrade to Pro — share decks privately, control downloads, hide ads and more …

JQuery

 JQuery

Mohamed Loey

May 26, 2015
Tweet

More Decks by Mohamed Loey

Other Decks in Education

Transcript

  1. wHaT IS jQUERY? • JQuery is a fast, small, and

    feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers. • JQuery is a lightweight, "write less, do more".
  2. wHY jQUERY? • Cross-browser Compatibility • Fast & Small •

    • Many of the biggest companies on the Web use JQuery, such as: 1. Google 2. Microsoft 3. IBM
  3. agENDa Part I: JQuery Syntax  JQuery Syntax  JQuery

    Selectors  Element Selector  The #id Selector  The .class Selector  JQuery Event
  4. jQUERY SYNTax • With jQuery you select (query) HTML elements

    and perform "actions" on them. • Basic syntax is: $(selector).action() A $ sign to define/access jQuery A (selector) to "query (or find)" HTML elements A jQuery action() to be performed on the element(s)
  5. ExamplES $(this).hide() - hides the current element. $("p").hide() - hides

    all <p> elements. $("p").hide() - hides all <p> elements. $(".test").hide() - hides all elements with class="test". $("#test").hide() - hides the element with id="test".
  6. jQUERY SElEcTORS oJQuery selectors are one of the most important

    parts of the jQuery library. oJQuery selectors allow you to select and manipulate HTML element(s).
  7. ElEmENT SElEcTOR oThe jQuery element selector selects elements based on

    the element name. oYou can select all <p> elements on a page like this: $("p")
  8. THE #ID SElEcTOR oThe JQuery #id selector uses the id

    attribute of an HTML tag to find the specific element. oExample:
  9. jQUERY EvENT ojQuery is made to respond to events in

    an HTML page. oHere are some common events: Mouse Events Keyboard Events Form Events Document/Window Events click keypress submit load dblclick keydown change resize mouseenter keyup focus scroll mouseleave blur unload
  10. agENDa Part III: JQuery Effects  JQuery Hide/Show  JQuery

    Fade  JQuery Slide  JQuery Animate  JQuery Stop Animation
  11. jQUERY faDINg • JQuery has the following fade methods: •

    fadeIn() • fadeOut() • fadeToggle() • fadeTo()
  12. jQUERY faDEIN() • The jQuery fadeIn() method is used to

    fade in a hidden element. • Example:
  13. jQUERY faDEOUT() • The jQuery fadeOut() method is used to

    fade out a visible element. • Example:
  14. jQUERY faDETO() • The jQuery fadeTo() method allows fading to

    a given opacity (value between 0 and 1). • Example:
  15. jQUERY SlIDINg • JQuery has the following slide methods: •

    slideDown() • slideDown() • slideUp() • slideToggle()
  16. jQUERY aNImaTIONS • The jQuery animate() method is used to

    create custom animations. • Example:
  17. jQUERY STOp aNImaTIONS • The jQuery stop() method is used

    to stop animations or effects before it is finished. • Example: