
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
In this cheat sheet you find Selectors and Events of JQuery
Typology: Cheat Sheet
1 / 1
This page cannot be seen from the preview
Don't miss anything!
Selectors $('*'); $('element'); $('.class'); $('#ID'); $('selector1, selector2, selectorN'); DOM .append() .prepend() .appendTo() .prependTo() .after() .before() .insertAfter() .insertBefore() .next() .prev() .data() .attr('attributeName','atribute') .removeProp() prop() .empty() .remove() .removeAttr() .first() .last() .children() .find() .html() .text(); .val() .end() .css('styleName','style') .addClass() .removeClass() toggleClass() .eq() .end() not() var object = $.extend({}, object1, object2); Animations and Effects .slideUp() .slideDown() .width('0px') .height('0px') .fadeOut(ms) .fadeIn(ms) .hide(ms) .show(ms) .fadeToggle() .slideToggle() .toggle('fast,slow',ms) .finish() .stop() .queue() clearQueue() .dequeue() .animate({'regla:css'},ms,function(){}); Event List Browser Events .resize() .scroll() Document Loading .holdReady () ready() Event Handler Attachment .on() .bind() form events .blur() .change() .focus() .select() .submit() Keyboard Events .keydown() .keypress() .keyup() Mouse Events .click() .dblclick() focusin() focusout() .hover(handlerIn,H andlerOut) .hover(handle rInOut) .mousedow n() .mouseenter() .mouseleave( ) .mousemo ve() .mouseout() .mouseover() .mouseup() basic syntax $('selector') .methodOne() .methodTwo() .methodN(); encapsulated function (function(){ })(); Event Object e.currentTarget e.data e.isDefaultPrevented() e.namespace e.isImmediatePropagationStopped() e.isPropagationStopped() e.pageX e.pageY e.preventDefault() e.relatedTarget e.result e.stopImmediatePropagation() e.stopPropagation() e.target e.timeStamp e.type e.which Event Handler $('selector').event(functionName); $('selector').event(function(){}); $('selector').on('event',functionName); $('selector')on('event',functionName(){}); $bind('event',function); $(this) AJAX .ajaxComplete() ajax.Error() .ajaxSend() .ajaxStart() .ajaxStop() .ajaxSuccess() Helper Functions JQuery.param() .serialize() serializeArray() Low-Level Interface JQuery.ajax() JQuery.ajax.Setup() ShortHand Methods JQuery.get() JQuery.getJSON() JQuery.getScript() JQuery.getScript().load() JQuery.post() By luigi cheatography.com/luigi0555/ Published 23rd May, 2016. Last updated 23rd May, 2016. Page 1 of 1. Sponsored by Readability-Score.com Measure your website readability! https://readability-score.com