Closed biglovisa closed 8 years ago
Here are a few notes from each section of Bocoup’s jQuery tutorial:
JavaScript Fundamentals
jQuery Basics
Traversing & Manipulating the DOM
Events & Event Delegation
Animating with jQuery
AJAX & Deferreds
.is()
also proves be nice for 'testing'text
) will act on a single(first) elem. setters will implicitely iterate
through all elements. Setters also take an anon Func..end()
is pretty clever. Wouldn't this be the same as making an initial selection and using it when needed?
.addBack()
which I find even more confusing. Just use a var..css()
e
get
and post
methods since they dont provide a success/failure
block. The methods are still Asynchronous and can still err out? correct?done
, then
, fail
, always
jQuery(‘li’
) === $(‘li’)
$(document).ready()
ensures the correct state of the page$()
will create a new element when passed a html snippet.filter()
.has()
and .not()
.first()
.siblings()
.next()
.parent()
.children()
etc..end()
reverts to original selection.addClass()
and .removeClass()
but .toggleClass()
is often better.css()
to change css classes.val()
.attr()
to change other attributes.append()
is called on a list whereas .appendTo()
is called on a list item.insertAfter()
and .after()
.detach()
, .remove()
, and .replaceWith()
are used for removing elements from the document.on(‘click’, function() {do stuff})
can be used, but jQuery provides shorthand methods such as .click
, .keydown
, .keypress
, etc..on()
jQuery.fx.speeds.nameOfSpeed = x
where x
is time in milliseconds.$('.myClass').hide(nameOfSpeed)
.animate()
.stop()
and .delay()
can manage animations
Submit links to your work/ask questions about jQuery fundamentals here.